题解 | #找出每个学校GPA最低的同学#

找出每个学校GPA最低的同学

https://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065

select t2.device_id, t1.*
from (
    select university, min(gpa) gpa
    from user_profile
    group by university
) t1, user_profile t2
where t1.gpa = t2.gpa and t1.university = t2.university
order by t1.university asc

先查询每个学校的最低gpa,再根据gpa查询用户

全部评论

相关推荐

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