使用窗口函数,先分组(按university)也就是partition by university,分组后每组的gpa升序,命名为rk,那么每组的最小值就是排在第一位的值,即需rk=1就可以得到每组的最小值; SELECT device_id, university, gpa FROM (select device_id, university, gpa, row_number() over (partition by university order by gpa) rk from user_profile) as a where rk = 1