我正在使用此查询
SELECT * FROM notes ORDER BY id DESC LIMIT 3
显示最新的三个音符显示如下: 注24,注23,注22
我要做的是显示结果如下: 注22,注23,注24。 任何想法?
答案 0 :(得分:2)
重新选择结果行重新排序,但这次使用ASC
顺序(默认值):
SELECT *
FROM (SELECT * FROM notes ORDER BY id DESC LIMIT 3) x
ORDER BY id
答案 1 :(得分:1)
你可以尝试
SELECT * FROM (SELECT * FROM notes ORDER BY id DESC LIMIT 3)
AS t ORDER BY t.id ASC;