破题,不看提示硬控我五个小时,最后参考区间法做出

with median as (
       select grade,number,he,add_up,med,lag(add_up)over(order by grade) la
       from (select grade,number,sum(number)over() he,sum(number)over(order by grade) add_up,sum(number)over()/2 med
        from class_grade) t1
    )
select grade
from median 
where med between la and add_up