with grade_num as (
select
job,
count(job) as cnt
from
grade
group by
job
)
select
job,
case
when mod(cnt,2) = 1 then round((cnt + 1) / 2,0)
when mod(cnt,2) = 0 then round(cnt / 2,0)
end as start,
case
when mod(cnt,2) = 1 then round((cnt + 1) / 2,0)
when mod(cnt,2) = 0 then round((cnt / 2) + 1,0)
end as end
from
grade_num
order by
job


京公网安备 11010502036488号