Delete repeated results from MySQL query

后端 未结 5 1841
故里飘歌
故里飘歌 2021-01-21 13:53

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         


        
5条回答
  •  花落未央
    2021-01-21 14:22

    Very easy. use following query:

    SELECT totalpoints, name
    FROM table_name
    GROUP BY name
    ORDER BY totalpoints DESC
    

提交回复
热议问题