SELECT job, CASE WHEN count(id)%2=1 THEN (count(id)+1)/2
WHEN count(id)%2=0 THEN count(id)/2
END AS start,
CASE WHEN count(id)%2=1 THEN (count(id)+1)/2
WHEN count(id)%2=0 THEN (count(id)+2)/2
END AS END
FROM grade
GROUP BY job
ORDER BY job
依照题意有如下中位数区间
START END
奇数 (N+1)/2 (N+1)/2
偶数 N/2 (N+2)/2