开发者

Selecting specific values in a DB (sorta...)

开发者 https://www.devze.com 2022-12-13 05:42 出处:网络
Ok, I had a hard time coming up开发者_运维百科 with a title, as you can probably tell. Anyway, I need to select 5 items from a DB excluding the first one. More specifically, I have items in a DB, each

Ok, I had a hard time coming up开发者_运维百科 with a title, as you can probably tell. Anyway, I need to select 5 items from a DB excluding the first one. More specifically, I have items in a DB, each with a specific, auto-incrementing ID. I need to select the first 5 after the item with the highest ID. What would be the best way to do this? Thanks!

-iMaster


The LIMIT clause:

SELECT * FROM table ORDER BY `id` DESC LIMIT 1, 5
0

精彩评论

暂无评论...
验证码 换一张
取 消