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

Limiting Result Set in group by query

Status
Not open for further replies.

mmiram

IS-IT--Management
Feb 4, 2005
45
US
Hi all:

I have two tables I am joining on the field "name" and grouping by the field "subdivision".

This is the issue I have. I want to pull only the top 5 names based on sales value (which is one of the fields) in each subdivision. Currently, each subdisivion has almost 100 names each. How can I restrict the result set to include only the top 5 names from each subdivision.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top