题解 | 考试分数(四)
考试分数(四)
https://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c
select job,round(case when count(id)%2=1 then (count(id)+1)/2 else count(id)/2 end,0) as start, round(case when count(id)%2=1 then (count(id)+1)/2 else 1+count(id)/2 end,0) as end from grade group by job order by job
刚开始我没加round,报错,可能原因是 没用round计算出的是浮点数,而题目要求的是整数

