大家好,我是小跳,我来为大家解答以上问题。分数段统计表,分数段很多人还不知道,现在让我们一起来看看吧!
1、sql怎么写统计各分数段的人数
2、select count(case 分数字段 when 100 then 1 end) as [满分],
3、count(case when 分数字段 between 90 and 99 then 1 end) as[90-99分],
4、count(case when 分数字段 between 80 and 89 then 1 end) as[80-89分],
5、count(case when 分数字段 between 70 and 79 then 1 end) as[70-79分],
6、count(case when 分数字段<70 then 1 end) as[70分以下]
7、from 学生分数表
本文到此讲解完毕了,希望对大家有帮助。