select a.job, 
ceil((a.count_)/2) start, 
ceil((a.count_+1)/2) end
from
(select job,count(*) count_
from grade 
group by job) a
order by a.job
  • 求中位数位置
  • 利用特殊值带入验算