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

retriving a specific number of matches

Status
Not open for further replies.

tourtch

Programmer
Jul 20, 2002
2
EG
hi all

i want to retriving a specific number of matches
in my query not all matches

select * from my-table (return five matches only)

Thanks
 
Use TOP 5 to return 5 records. See SQL BOL for more details.

Select Top 5 *
From table
Where <criteria>
Order By <columnlist> Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains &quot;Suggestions for Getting Quick and Appropriate Answers&quot; to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top