题解 | #获得积分最多的人(二)#

获得积分最多的人(二)

http://www.nowcoder.com/practice/b6248d075d2d4213948b2e768080dc92

select user.id ,user.name,sum(grade_num) grade_num from user join grade_info on user.id = grade_info.user_id group by name,user_id having grade_num >= ( select sum(grade_num) grade_num from user join grade_info on user.id = grade_info.user_id group by name order by grade_num desc limit 1) order by user_id;alt

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务