SQL Help

  • Thread starter Thread starter Wee
  • Start date Start date

Wee

Wee

Associate
Joined
25 Apr 2006
Posts
130
Location
Scotland
Working on some web stuff at the moment, and have come across a problem. I have a table in my database that is choco-block full of rows, but only want to display the 5 latest entries instead of them all. I was wondering it there is an SQL statement that is able to only output a specific number of rows?
 
The database is SQL Server 2005.

They won't be indexed by an incremented key number, most likely will be done by date.
 
arty said:
I'd have thought it'd be a SELECT TOP 5 * FROM <TABLENAME> ORDER BY <COLUMN NAME> DESC if it's MS SQL Server :)

arty

Appreciate the help folks, it worked a treat!
 
Back
Top Bottom