Dla każdej value
, możesz uzyskać maksimum dla grup
:
SELECT * FROM Scores NATURAL JOIN (
SELECT player_id, value1, value2, MAX(value3) value3 FROM Scores NATURAL JOIN (
SELECT player_id, value1, MAX(value2) value2 FROM Scores NATURAL JOIN (
SELECT player_id, MAX(value1) value1 FROM Scores
GROUP BY player_id) t
GROUP BY player_id) t
GROUP BY player_id) t
ORDER BY value1 DESC, value2 DESC, value3 DESC
Zobacz go na sqlfiddle .