题解 | #找出每个学校GPA最低的同学#
找出每个学校GPA最低的同学
https://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065
select b.device_id,a.university,b.gpa from (select university,min(gpa) mingpa from user_profile group by university ) a,user_profile b where a.university=b.university and a.mingpa=b.gpa order by a.university asc 求 gpa最低的大学似乎比较简单 直接分组查询就可以实现 但是题意中要求查询到最低的device_id 这个列不是分组列,不能再分组里直接查询 因此想到通过连接实现