SQL - SUM, Distinct and TOP 4

Viewed 237

I have a query for a table that I cant get to work.

Below are tables examples;

Table Members:

|ID|NAME|
|1 |John|
|2 |Joe |
|3 |Paul|

Table Scores:

|ID  |Score |                       
|1   | 25   |                       
|1   | 34   |                       
|2   | 54   |                       
|1   | 23   |                       
|3   | 43   |                     
|2   | 14   |                       
|1   | 23   |                       
|3   | 43   |                     
|3   | 14   |                                             
|3   | 43   |                     
|2   | 14   |                       
|1   | 23   |                       
|3   | 43   |                     
|3   | 14   | 

I want to display the members name and then Sum there best 2 scores, and display it with largest SUM'd score first.

|Paul| 86 |
|Joe | 68 |
|John| 57 |

Thanks in advance

3 Answers
Related