我想显示最后3行的mysql表,每行应该出现在一个单独的div中。我能够显示最后一行,但无法弄清楚如何显示前面的其他两行。这是我如何做到的:
library(dplyr)
library(tidyr)
newdata <- data %>%
gather(., year, value, year1:year3) %>%
mutate(newvalue = ifelse(type > 2, value * 2, value)) %>%
select(-value) %>%
spread(., year, newvalue)
答案 0 :(得分:1)
尝试使用此查询:SELECT * FROM movies ORDER BY id_movie DESC LIMIT 3