SELECT device_id, university, gpa FROM( SELECT device_id, university, gpa, RANK() OVER (PARTITION BY university ORDER BY gpa) rk FROM user_profile ) tb WHERE tb.rk = 1;
SELECT device_id, university, gpa FROM( SELECT device_id, university, gpa, RANK() OVER (PARTITION BY university ORDER BY gpa) rk FROM user_profile ) tb WHERE tb.rk = 1;