Find last Record in sql table
How to Find Last Record in SQLtable without using Top and max
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vikram AgrawalRank #4,713 · 329 reputationPosted Dec 9, 2014, 3:37 AM EST
you can find last row like this without using top/max
set rowcount 1
Select * From MyTable Order By Id Desc
Mukesh Kumar TiwariRank #1,774 · 844 reputationPosted Dec 9, 2014, 3:40 AM EST
VulpesRank #55 · 29.2K reputationPosted Dec 9, 2014, 3:43 AM EST
In SQL Server you do what Vikram described.
If you're using MS Access, MySQL or Oracle, you can use the approaches described here:
http://www.w3schools.com/sql/sql_func_last.asp