Hello I have the following table design
ID account_id score date ------------------------------------------ 1 500 4 x 2 764 4 x 3 500 6 x 4 500 7 x 5 764 5 x
I'm trying to get all rows with the latest account_id entry
so my code should return
ID account_id score date ------------------------------------------ 4 500 7 x 5 764 5 x
I tried the following code but it seems to return the first entry but with the latest date
SELECT account_id,score, max(date) from table group by account_id