Top 5 with grouping

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get the top 5 results for each region. Any help would be
appreciatted, below is my sql thus far.

SELECT TOP 5 QryNullConv.AbsError, QryNullConv.DmdUnit, QryNullConv.Loc,
QryNullConv.Region
FROM QryNullConv;
 
TOP 5 for the region based on what.- the number of AbsError?

SELECT q.Region, q.AbsError, Q.DmdUnit, Q.Loc
FROM qryNullConv as Q
WHERE Q.AbsError in (
SELECT TOP 5 absError
FROM qryNullConv as T
WHERE T.Region = Q.Region
ORDER BY absError DESC)


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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

Similar Threads


Back
Top