我有一张scores
桌子:
id
user
score
date
现在,我可以轻松地选择前 10 名的高分
SELECT user, score, date FROM scores ORDER BY score DESC
但是,我只想为每个用户提供一个分数,即他的最高分。我会从类似的东西开始
SELECT user, MAX(score) AS score FROM scores GROUP BY user ORDER BY score DESC
但是,现在我已经失去了date
记录的最高分。我如何得到它?