先求和,然后排名,最后取出排名为1的 SELECT a.name,b.gsum FROM user a,(SELECT user_id,gsum,DENSE_RANK()OVER(ORDER BY gsum DESC) AS rank FROM(SELECT user_id,SUM(grade_num) AS gsum FROM grade_info GROUP BY user_id)) b WHERE a.id = b.user_id GROUP BY user_id HAVING b.ran...