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
 Transact-SQL (2000)
 First Five records from the table

Author  Topic 

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-03-12 : 11:23:50
Hi friends

How can i select the first five records from the table?

Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-12 : 11:27:55
Term "First n records" has no meaning in the RDBMS unless you specify on what basis you decide first or last record.

Select Top 5 *
from Table
Order by SomeColumn -- this is important


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-03-12 : 12:46:16
Thanks
Go to Top of Page
   

- Advertisement -