分组对user_id求和,然后取出最高位即可
SELECT u.name, t.grade_sum FROM (SELECT user_id,SUM(grade_num) "grade_sum" FROM grade_info WHERE TYPE = "add" GROUP BY user_id)t LEFT JOIN `user` u ON t.user_id = u.id ORDER BY t.grade_sum DESC LIMIT 0,1