Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Select top 5 records

Author  Topic 

rlull
Starting Member

39 Posts

Posted - 2006-09-13 : 16:22:04
How do I select the most recent 5 records from my database? Is there a select top 5 function? For example, here are the columns I want:

SELECT NID, Title, HeadlineImage FROM News ORDER BY NID DESC

There are thousands of records and I only want the last 5.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-09-13 : 16:33:15
SELECT TOP 5 NID, Title, HeadlineImage
FROM News
ORDER BY NID DESC

Tara Kizer
Go to Top of Page
   

- Advertisement -