Reputation: 64904
If I have multiple records in a SQL table like:
name score
...................................
sami 55
ali 140
sami 60
I want to select the highest score for each player. The expected result would be:
ali ,140
sami, 60
Upvotes: 1
Views: 1307
Reputation: 77896
Select name,max(score) as 'Highest Score' from gametable group by name;
Upvotes: 1
Reputation: 3026
Looks like it is as simple as that:
SELECT name, MAX(score) FROM <table_name> GROUP BY name
Upvotes: 1