Mysql Select Second Row

前端 未结 4 1926
既然无缘
既然无缘 2021-02-12 18:29

I have a mysql question.


I have a news section on my website, and I want to display the two latest items. If I do:

SELECT * FROM nieuws ORDER BY id         


        
4条回答
  •  借酒劲吻你
    2021-02-12 18:44

    SELECT * FROM nieuws ORDER BY id DESC LIMIT 2 - selects last 2 items

    SELECT * FROM nieuws ORDER BY id DESC LIMIT 1, 1 - selects only second item

提交回复
热议问题