I have a Scores table with 3 fields: ID, Week-Number, and Score.
This is for a double-elimination dart league, so each week can have any number of rows per ID, although it is rare for one person to have more than 7 scores in any one week.
We have a table for players that contains player name and player ID.
We want to calculate a handicap for each person as follows:
1. find the average of the highest scores for each person using only the 3 highest scores for that person (if he/she had 3 scores - might only be 2).
2. Calculate the average of the 20 most recent averages for each player.
3. Produce a report with Player Name and the calculated average.
I have two questions:
1. Can this be done in one single query or do we need to have queries calling queries?
2. Even if it can be done, does this make sense or should we use individual queries?
Thanks to anyone who can help.