select device_id,university,gpa from
(select device_id,university,gpa,row_number () over(partition by university order by gpa asc) rankNum
from 
(select device_id,university,round(min(gpa),4) gpa from user_profile 
group by university,device_id
 )t) tt
where tt.rankNum = 1
order by university asc

获取每个学校gpa的排名,再获取gpa排名最低。