how to select the 5 latest row from my mysql

后端 未结 5 465
故里飘歌
故里飘歌 2021-01-20 16:11

I wanted to know the sql command to retrieve 5 latest row from my table? Below is my sql query. How am I going to do, in order it can select the 5 latest row base on row

5条回答
  •  余生分开走
    2021-01-20 16:30

    Might be a very late answer, but this is good and simple.

    select * from table_name order id desc limit 5
    

    This query will return a set of last 5 values(last 5 rows) you 've inserted in your table

提交回复
热议问题