userID point
111 20
111 30
222 40
222 50
Run Code Online (Sandbox Code Playgroud)
我想点这样订购
222 50
111 30
Run Code Online (Sandbox Code Playgroud)
DESC的每个userId Max值顺序
按MAX点值排序
SELECT userID, MAX(point)
FROM [table]
GROUP BY userID
ORDER BY MAX(point) DESC
Run Code Online (Sandbox Code Playgroud)