我想获得最后6行,但跳过结果中的最后一行:
SELECT * FROM stats_follow ORDER BY id DESC LIMIT 6
我该怎么做?
答案 0 :(得分:0)
试试这个:
SELECT *
FROM (SELECT *
FROM TableName
ORDER BY FieldName DESC
LIMIT 5) sub
ORDER BY FieldName ASC
答案 1 :(得分:0)
试试这个:
SELECT * FROM stats_follow ORDER BY id DESC LIMIT 1,6