Only return top 5 records per category

Joined
Oct 12, 2012
Messages
2
Reaction score
0
Here is the query..what I want to have returned is only the top 5 records (for each Sum([Placings & Points].Points) for each of the Awards.[SPHO-Ohio Approved Classes Awards]..

So what I have are about 25 separate awards...based on the sum of the points earned. And I need to return only the highest 5 total points for each of the awards




SELECT Awards.[SPHO-Ohio Approved Classes Awards], ) AS SumOfPoints, [2012 Points].Members
FROM (Awards INNER JOIN (Classes INNER JOIN (Events INNER JOIN [2012 Points] ON Events.ID = [2012 Points].[Show or Event]) ON Classes.ID = [2012 Points].Class) ON Awards.ID = Classes.[Award Division]) INNER JOIN [Placings & Points] ON [2012 Points].Placing = [Placings & Points].ID
WHERE (((Events.[SPHO Show])=-1))
GROUP BY Awards.[SPHO-Ohio Approved Classes Awards], [2012 Points].Members
ORDER BY Awards.[SPHO-Ohio Approved Classes Awards], Sum([Placings & Points].Points) DESC;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top