select g.job,ceil(max(r)/2) start,case when max(r)%2=0 then round(max(r)/2+1,0) when max(r)%2=1 then ceil(max(r)/2) end end from ( select *,rank()over( partition by job order by score ) r-- 考虑会有重复的数据出现,此处用排序占位 from grade ) g group by g.job