I have 2 tables:
Players
ID | Name |
---|---|
1 | John |
2 | Maya |
3 | Carl |
Results
ID | Player_ID | Result |
---|---|---|
1 | 1 | 250 |
2 | 1 | 300 |
3 | 2 | 100 |
4 | 2 | 350 |
5 | 3 | 500 |
I want to select all the names from the table Players and the top scores of each person. What I have so far:
SELECT Players.Name, max(Results.Result)
FROM Players JOIN Results
WHERE Players.ID = Results.Player_ID
But this only selects
| Carl | 500 |
and I want
| John | 300 |
| Maya | 350 |
| Carl | 500 |