Last N records from a Table in SQL
How to select last N records from a Table ?
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
Shankar MRank #874 · 2.5K reputationPosted Nov 23, 2012, 1:25 AM EST
Use the Order by Clause in your Query.
Something like this,
SELECT TOP N * FROM EMP ORDER BY EMPNO DESC
Thanks,
Shankar
Krishna GaradRank #191 · 12.8K reputationPosted Nov 23, 2012, 1:26 AM EST
Select Top 10 * From TableName order by Id Desc
Else
Take a look here
Vithal WadjeRank #19 · 47.2K reputationPosted Nov 23, 2012, 1:36 AM EST