Aggregate keeping the row with the max value

Posted by Luca Bernardi on Stack Overflow See other posts from Stack Overflow or by Luca Bernardi
Published on 2010-04-27T09:36:11Z Indexed on 2010/04/27 9:43 UTC
Read the original article Hit count: 298

Filed under:
|

Suppose you have the following schema (id, user_id , score). How can I take per each user the row with max score and then order all row for score. In other word I want a ranking where each user have his best result.

© Stack Overflow or respective owner

Related posts about mysql-query

Related posts about sql