题解 | #找出每个学校GPA最低的同学#
找出每个学校GPA最低的同学
http://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065
exists关键字解决不方便使用group的情形
思路 不存在比这个人分还低且在一个学校的人
select device_id,university,gpa FROM user_profile as a
where not exists
(select b.gpa from user_profile as b
where a.university= b.university and a.gpa>b.gpa)
order by university;
where not exists
(select b.gpa from user_profile as b
where a.university= b.university and a.gpa>b.gpa)
order by university;