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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting X records 2

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
hello,

is there a way of selecting x number of records.

So i have a table and want to sort the table and then grab only the first 10 top records.

is this possible with a select statement?

thanks
1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
hi,
that isn't really difficult:

select TOP 10 * from xyz order by [Name]

cya
andy
 
Code:
SELECT TOP 10 .....
.....
ORDER BY ....


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
excellent - thanks a million guys

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top