question regarding retreiving on the top N of results

Database
Fan

question regarding retreiving on the top N of results

I am trying to pull the top 200 results based on a calcuated sum

I.E. Something like this

Joe 2000
Jack 1999
Jill 1998
Jose 1997

Etc...

I was under the impression that there was fairly simple command for this but I could be wrong.

Thanks
1 REPLY
Enthusiast

Re: question regarding retreiving on the top N of results

SELECT TOP 200 Name, SUM(Quantity) FROM Table GROUP BY Name ORDER BY SUM(Quantity) DESC;