Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Top 10 sum & count

$
0
0

I have been working on this Select statement all day (blogs & testing) and I guess it's time to seek some help.

This is for my golf league to determine who is in the lead and determine the points each person has earned. Each week the golfer plays we enter data into a table (ParPoints) about the round and the 3 columns pertinent for this query are GolfID, Season and Points. I suspect that I might come out of this with more than one Select statement and that is fine as I will be filling dataTables with the results before using it.

First off I only want rounds from this season (2014). Then I want to order the Points DESC for each GolfID & select the top 10 (10 best rounds by points).   I only want 10 and 11-? aren't needed. I want to capture this raw data because I want to report on it. It would be a great help to get this step completed.

Next using the raw data (above) I want to sum the points for each GolfID.

Then I want to count all of rounds actually played by each golfer. Actually If this has to be done by itself I can do it, but making it part of the bigger query I can not do.

So an help to get me started would be of great assistance.

Thanks

Gary


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>