• 本站域名:OceanCoder.cn 若您喜欢本站,请添加至收藏夹!
  • 网站少部分资源来源自网络,如有侵犯您的权益,请联系站长删除!
  • 本站所有文章,除特殊标明外,皆为本人原创,转载请注明出处,谢谢合作!
  • 本站所下载的资源,若无特殊说明,使用统一解压密码:oceancoder.cn
  • 本站已实现布局自适应,支持手机端、pad端访问,欢迎体验
  • 本站部分资源可通过微信公众号留言获取,欢迎体验

sql分段获取记录数量, 例如成绩分组

编程笔记 OceanCoder 2022-08-17 1111 次浏览 0个评论

select sum(case when score between 90 and 100 then 1 else 0 end) as A,

sum(case when score between 80 and 89 then 1 else 0 end) as B,

sum(case when score between 70 and 79 then 1 else 0 end) as C,

sum(case when score between 60 and 69 then 1 else 0 end) as D,

sum(case when score<60 then 1 else 0 end) as E

from z_experiment_score


已有 1111 位网友参与,快来吐槽:

发表评论