题解 | #考试分数(四)# 考察MOD取余判断奇偶
考试分数(四)
https://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c
with t1 as ( select job, count(score) as cnt from grade group by job ) select job, (case when MOD(cnt, 2) = 0 then round(cnt/2,0) else CEILING(cnt/2) end) as start, (case when MOD(cnt, 2) = 0 then round(cnt/2,0) + 1 else CEILING(cnt/2) end) as end from t1 order by job;