+ 1
what if we need the last 5 records?
3 Answers
+ 3
Select * from table_name order by id desc limit 5;
+ 1
ORDER BY id DESC LIMIT 5
+ 1
otherwise if you are using sql server you can write SELECT TOP(5), Remember to use order by to sort the rows from the newest to the last