题目要求:
根据作品的分数进行分组
90> 优秀
90> 且 >=80 良好
80> 且 >=60 及格
>60 不合格
统计出每种的数量
sql
SELECT count(*) as value,
case when work_total_all_score < 60 then '不及格'
when work_total_all_score >= 60 and work_total_all_score < 80 then '及格'
when work_total_all_score >= 80 and work_total_all_score < 90 then '良好'
else '优秀' end as name
FROM score02.work
GROUP BY name
注意在mybatis中
小于号需要使用 <替换
大于等于需要使用>=
SELECT count(*) as value,
case when work_total_all_score < 60 then '不及格'
when work_total_all_score >= 60 and work_total_all