题解 | 找出每个学校GPA最低的同学
找出每个学校GPA最低的同学
https://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065
select device_id, a.university, a.gpa from user_profile a join (select university, min(gpa) mingpa from user_profile c group by university) b on a.university = b.university and a.gpa = b.mingpa order by university
考查的就是子查询,可以用in,也可以用join,但我喜欢用join,join的性能会更好一点