题解 | #各年级学生的平均绩点#

各年级学生的平均绩点

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

全部评论

相关推荐

仁者伍敌:难怪小公司那么挑剔,让你们这些大佬把位置拿了
点赞 评论 收藏
分享
昨天 12:24
重庆大学 运营
坏消息:和好工作擦肩而过
给点吧求求了:怎么可能因为差几秒,估计就是简历更好看婉拒了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务