I have a table like this:
id | date | score
-----------------------
1 | 2017-12-01 | 10
1 | 2017-12-02 | 20
2 | 2017-12-01 | 30
2 | 2017-12-02 | 40
2 | 2017-12-03 | 50
3 | 2017-12-03 | 60
I want to get the latest score per id like so:
id | date | score
-----------------------
1 | 2017-12-02 | 20
2 | 2017-12-03 | 50
3 | 2017-12-03 | 60
So far I have something like this:
SELECT
id,
MAX(date)
FROM
mytable
GROUP BY
id
But I don't know how to get the score of the row of the MAX(date) per id