View Single Post
  #1 (permalink)  
Old March 25th, 2008, 02:12 PM
crabjoe crabjoe is offline
Authorized User
Points: 254, Level: 5
Points: 254, Level: 5 Points: 254, Level: 5 Points: 254, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: , , .
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select .. Top 10 by Month?

Lets say I have a table, named t_savings, with 3 fields (Month, Name, and Saving). And with every month, there's 100 people being tracked.

Now lets say I want the Top 10 Savers by month. Is there a easy way to do this?

I know "select top 10 * from t_savings order by saving desc" will give me the top 10, but I want it based by month also but don't want to have to have a separate query for every month.

Thanks!



Reply With Quote