Detta bör ge dig det resultat du letar efter. Eftersom MySql inte har en PARTITION
fungerar som SQL SERVER, använde jag en känd lösning.
SELECT tmp.id, tmp.userid,tmp.username,tmp.`date`,score FROM
(SELECT *, IF(@prev<>userid, @rownum := 1, @rownum := @rownum+1 ) AS rank,
@prev := userid
FROM scores s0
JOIN (SELECT @rownum := NULL, @prev := 0) AS r
ORDER BY s0.userid, s0.score DESC, s0.`date` DESC
) AS tmp
WHERE tmp.rank=1
ORDER BY tmp.score DESC, tmp.`date` desc