Mysql Select Second Row

前端 未结 4 1923
既然无缘
既然无缘 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 19:00

    SELECT * FROM table where id >(SELECT id FROM table order by id ASC limit1,1) and id <=(select max(id) from table)

提交回复
热议问题