//希望对你有帮助 select a.sid, b.sname, sum(case when  c.cname="course01" then a.score end) as "course01", sum(case when  c.cname="course02" then a.score end) as "course02", sum(case when  c.cname="course03" then a.score end) as "course03", sum(case when  c.cname="course04" then a.score end) as "course04", sum(a.score) as "总分", avg(a.score) as "平均分" from scores a left join stu b on a.sid=b.sid left join coures c on a.cid=c.cid group by b.sname order by a.sid
点赞 评论

相关推荐

牛客21331815...:像我一投就pass,根本不用焦虑泡池子
点赞 评论 收藏
分享
牛客吹哨人:哨哥晚点统一更新到黑名单:能救一个是一个!26届毁意向毁约裁员黑名单https://www.nowcoder.com/discuss/1525833
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务