Dette burde give dig det resultat, du leder efter. Da MySql ikke har en PARTITION
fungerer som SQL SERVER, brugte jeg et kendt arbejde rundt.
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