查询学生考试得分区间人数,根据"10-20","20-30","30-40","40-50","50-60","60-70","70-80","80-90","90-100"分组

select elt(
interval(get_point,10,20,30,40,50,60,70,80,90),
"10-20","20-30","30-40","40-50","50-60","60-70","70-80","80-90","90-100"
) as score_level ,count(*) as peopleNum
from pf_work_history
WHERE work_id = #{workId}
group by elt(
interval(get_point,10,20,30,40,50,60,70,80,90),
"10-20","20-30","30-40","40-50","50-60","60-70","70-80","80-90","90-100"
);
posted @ 2023-03-14 09:22  了悟  阅读(29)  评论(0编辑  收藏  举报