Select last row in a table?
I have a SQL table named name. It contains 1000's of names. I enter new names to the table but I forgot what are these names. So I need to see last entered row using a query like select top(10)* from name.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Mar 25, 2014, 3:46 AM EDT
SELECT TOP 1 * FROM table ORDER BY id DESC
Munesh SharmaRank #174 · 13.9K reputationPosted Mar 25, 2014, 3:56 AM EDT
Select TOP 1 * FROM tablename ORDER BY id DESC
In mySql..
Select * FROM tablename ORDER BY id DESC Limit 1