Hi, I am trying to calculate and rank players in a golf tournament based on a table of scores. A players total score is determined by there best 11 scores only.
Part of the table might look something like..
Player Score
--------------------------------
Joe Bloggs 75
Joe Bloggs 76
Joe Bloggs 79
Jack Dodds 90
Jack Dodds 78
......
(the table is ordered by player and score)
So to calculate the over all score I would us something like
SELECT sum(score)
FROM score_table
GROUP BY player;
However my problem is that I only want to sum the best 11 scores of each player. e.g if Joe Bloggs had 15 scores I only want to sum the 11 best ones.
Could anyone help me out?
Cheers,
James
Part of the table might look something like..
Player Score
--------------------------------
Joe Bloggs 75
Joe Bloggs 76
Joe Bloggs 79
Jack Dodds 90
Jack Dodds 78
......
(the table is ordered by player and score)
So to calculate the over all score I would us something like
SELECT sum(score)
FROM score_table
GROUP BY player;
However my problem is that I only want to sum the best 11 scores of each player. e.g if Joe Bloggs had 15 scores I only want to sum the 11 best ones.
Could anyone help me out?
Cheers,
James