按分数进行分组,并将null转换为0,同时显示出所有列
在sql中将为null显示为0,分组进行展示出来(类似行转列)
select c ,sum(co)
from
(SELECT case
when t.score < 60 then '60分以下'
when t.score >= 60 and t.score < 70 then '60-70'
when t.score >= 70 and t.score < 80 then '70-80'
when t.score >= 80 and t.score
原创
2021-01-24 16:07:02 ·
247 阅读 ·
0 评论