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