20%的数据。
百分比的应用,一般来说是在开窗之后,本内容占到总比重的多少,或者说排序的时候需要把前多少位展示出来。topN和top%是某些展示过程中为了聚合主要数据也好,为了展示效果也好,会做的一个过滤。
select row_.*,rownum from ( select B1 as B1,A1 as A1
from (
select B1 as B1,A1 as A1,sum(B1) over ( order by B1 desc )/sum(B1) over () as totalpct2,(sum(B1) over ( order by B1 desc )-B1)/sum(B1) over () as totalpct3
from (
select sum(a.D3) as B1,a.BBQ as A1
from ZDSY_B1 a
where (a.BTYPE = '0')
group by a.BBQ) ab_) ab_
where (totalpct2<=0.2 or (totalpct2>0.2 and totalpct3=0)) )row_ where rownum <= 1000