题解 | #存在绩点大于该校平均绩点时的学生信息#
存在绩点大于该校平均绩点时的学生信息
https://www.nowcoder.com/practice/860fb125c6ac49b080766040f3bd902f
用窗口函数:
SELECT device_id,university FROM (SELECT device_id,university,gpa, avg(gpa)over(partition by university)avg_university_gpa FROM user_profile)user_profile_avggpa WHERE gpa>avg_university_gpa and avg_university_gpa>3.6 ORDER BY device_id DESC ;