题解 | #考试分数(四)#
考试分数(四)
http://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c
select co.job,
case when c%2=1 then round((c+1)/2,0) else round(c/2,0) end as start,
case when c%2=1 then round((c+1)/2,0) else round((c/2)+1,0) end as end
from
(select job, count(job) c from grade group by job) co
order by job
case when c%2=1 then round((c+1)/2,0) else round(c/2,0) end as start,
case when c%2=1 then round((c+1)/2,0) else round((c/2)+1,0) end as end
from
(select job, count(job) c from grade group by job) co
order by job