求中位数

select avg(midian) from(
select a.midian
from (
select d.midian
,row_number() over(order by midian) as rn
,count(*)over() as cnt
from t_basic_07 d
)a
where a.rn in (cnt/2,(cnt+1)/2,(cnt+2)/2)
)t

posted @ 2024-03-13 09:31  竹贤  阅读(1)  评论(0编辑  收藏  举报