sql 查分数段人数


select count(case 分数字段 when 100 then 1 end) as [满分],
count(case when 分数字段 between 90 and 99 then 1 end) as[90-99分],
count(case when 分数字段 between 80 and 89 then 1 end) as[80-89分],
count(case when 分数字段 between 70 and 79 then 1 end) as[70-79分],
count(case when 分数字段<70 then 1 end) as[70分以下]
from 学生分数表

 

使用union太慢

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM