Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get last 10 records from a table 1

Status
Not open for further replies.

kismet

MIS
Mar 5, 2003
24
PH
Hi! What sql command can I use in order to get the last 10 records of a table? One of the fields of the table is an AutoNumber. Other fields are dates, version numbers, etc.

Thank you in advance! =)
 
It depends on what you consider the 'last' records to be, the last 10 autonumbers?? The highest 10 dates?

Try something like

SELECT TOP 10 *
FROM Table
ORDER BY ID <b>DESC</b>

Transcend
[gorgeous]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top