To powinno działać: SELECT user_id, MAX(score) FROM user_scores GROUP BY user_id ORDER BY MAX(score) DESC LIMIT 5