题解 | #找出每个学校GPA最低的同学#
找出每个学校GPA最低的同学
https://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065
select device_id,university,gpa from( select device_id,university,gpa,rank() over (partition by university order by gpa) as rk from user_profile )as u where rk=1 考点窗口函数: 细节:当要求最小值题目要求升序,所以order by使用默认的排序否则要加desc 思路:利用窗口函数分出来一个新的表然后在select 把rank作为筛选结果。