日期:2014-05-17 浏览次数:20882 次
select * from (select rownum n,B.* from (select X.xybh,X.xymc, (select count(distinct XJ.kcdm) from xjkcwzb XJ where 1=1 and XJ.xyjsxxb_id in (select yhb_id from yhb) and XJ.kcdm in(select k.kcdm from kcdmb k) and (select K.xybh from kcdmb K where XJ.kcdm=K.kcdm)=X.xybh group by X.xybh) as xyjssl,(select count(distinct KC.kcdm) from kcdmb KC where KC.sfty=0 and KC.xybh=X.xybh group by X.xybh) as xykczs,((select count(distinct KC.kcdm) from kcdmb KC where KC.sfty=0 and KC.xybh=X.xybh group by X.xybh)-(select count(distinct XJ.kcdm) from xjkcwzb XJ where 1=1 and XJ.xyjsxxb_id in (select yhb_id from yhb) and XJ.kcdm in (select k.kcdm from kcdmb k ) and (select K.xybh from kcdmb K where XJ.kcdm=K.kcdm)=X.xybh group by X.xybh)) as xylszs,trunc((((select count(distinct XJ.kcdm) from xjkcwzb XJ where 1=1 and XJ.xyjsxxb_id in (select yhb_id from yhb) and XJ.kcdm in(select k.kcdm from kcdmb k ) and (select K.xybh from kcdmb K where XJ.kcdm=K.kcdm)=X.xybh group by X.xybh)/(select (case when count(distinct KC.kcdm)=0 then 1 else count(distinct KC.kcdm) end) from kcdmb KC where KC.sfty=0 and KC.xybh=X.xybh group by X.xybh ))*100),2) as xyjsqk from dual,xyxxb X order by to_number(X.xybh)) B )A where A.n between 1 and 20