题解 | #各年级学生的平均绩点#
各年级学生的平均绩点
https://www.nowcoder.com/practice/dff3780ac796402eac9e22e2a967f5bd
select (case when graduate_year=2022 then '大四' when graduate_year=2023 then '大三' when graduate_year=2024 then '大二' when graduate_year=2025 then '大一' end)grade,round(avg(gpa),2) avg_gpa from user_profile group by grade having 2022<=grade<=2025 order by round(avg(gpa),2) desc