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/Last

Author  Topic 

vicki
Posting Yak Master

117 Posts

Posted - 2002-02-26 : 17:30:23
Hi,

Select Top is work but how about if I want to selet last record?

Working:

SELECT TOP 5 *
FROM dbccresults

Not Working:
SELECT Last 5 *
FROM dbccresults

How can I make the Select Last work?

Thanks

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-02-26 : 17:34:08
You need to use ORDER BY in order for TOP to mean anything. In this case, if you need the last 5 number of rows, you need a SELECT TOP 5....ORDER BY column DESC.

Go to Top of Page
   

- Advertisement -