how to select the 5 latest row from my mysql

后端 未结 5 491
故里飘歌
故里飘歌 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:29

    Check out my query for last 5 entry

    SELECT * FROM notices where organizationid = $orgid ORDER BY `notices`.`id` DESC LIMIT 5
    

    So, Most Important is ORDER BY notices.id DESC LIMIT 5

提交回复
热议问题