题解 | #考试分数(四)#
考试分数(四)
http://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c
with job_rank as ( select job,score,count(job) as rk from grade group by job ) select job, round(if(mod(max(rk),2)=0,max(rk)/2,(max(rk)+1)/2),0) as 'start', round(if (mod(max(rk),2)=0,max(rk)/2 +1,(max(rk)+1)/2),0) as' end' from job_rank group by job order by job