题解 | #各年级学生的平均绩点#
各年级学生的平均绩点
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 '大一' else '其他' end) as grade,round(avg(gpa),2) as avg_gpa from user_profile group by grade having grade != '其他' order by avg_gpa desc
不能偷懒少写一行 因为有其他...