database - MySQL ranking feature -


i trying create ranking system using data in table. has 2 columns, name , score. 1 user can have multiple scores. have far:

("select name, score, find_in_set( score, (select group_concat ( score order score desc ) data )) rank scores"); 

but command lists user's previous scores when need highest score.

does know how can achieve this?

try

select name, sum(score) scores group name order sum(score) desc limit 1 

and if don't want sum use

select name, max(score) scores 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -