A MySQL query retrieves:
totalpoints -- name
55 -- John Doe
55 -- John Doe
55 -- John Doe
55 -- John Doe
55 -- John Doe
21 -- Jean London
21 -- Jean London
13
select name,totalpoints
from table
group by name
order by totalpoints desc
Very easy. use following query:
SELECT totalpoints, name
FROM table_name
GROUP BY name
ORDER BY totalpoints DESC
select distinct name,totalpoints from table
Please use DISTINCT keyword in your query to avoid duplicate entries
What about using DISTINCT? Seems pretty easy... But you actually tried to google it? ou would have found it in no time.