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

Finding the top 10 in a Query

Status
Not open for further replies.

chucky2000

Technical User
May 29, 2002
10
US
I need to query a table that contains a hundreds of clients. The query consists of pulling out the Top 10 or Top 30 clients as per volume. I can do this by the Count Function but this provided me with all of the clients with their volume. How would I retrieve just the Top 30 for example??
Thanks
Chucky
 
Code:
SELECT TOP 30 clients.........
FROM tablename
ORDER BY volume DESC;

If you don't specify the ORDER BY you will get a random set of records that meet the criteria.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top