题解 | #获得积分最多的人(二)#
获得积分最多的人(二)
https://www.nowcoder.com/practice/b6248d075d2d4213948b2e768080dc92
with g as( select user_id,sum(grade_num) gn from grade_info where type='add' group by user_id ) select g.user_id,u.name,gn from g join user u on g.user_id=u.id where g.gn=( select max(gn) from g );