再试试
--------------------------------------------------------------------------
select rownum,ABC.*
from
((select a.dhhm dhhm,c.khmc khmc,a.zxfjf-nvl(b.ydxfjf,0) dqxfjf,a.zzwjf-nvl(b.ydzwjf,0) dqzwjf,a.zjljf-nvl(b.ydjljf,0) dqjljf
,a.zxfjf-nvl(b.ydxfjf,0)+a.zzwjf-nvl(b.ydzwjf,0)+a.zjljf-nvl(b.ydjljf,0)+nvl(b.ljjzjf,0) zjf,nvl(b.ljdf,0) ljdf,nvl(b.ljjzjf,0) ljjzjf
from
(select dhhm,sum(xfjf) zxfjf,sum(zwjf) zzwjf,sum(jljf) zjlj from yx_jfdab group by dhhm)A,
(select dhhm,ydxfjf,ydzwjf,ydjljf,ljdf,ljjzjf from yx_jfdjljb)B,
(select dhhm,khmc,blzd8 from jfxt.yx_yhdab)C
where a.dhhm=b.dhhm(+) and a.zxfjf-nvl(b.ydxfjf,0)+a.zzwjf-nvl(b.ydzwjf,0)+a.zjljf-nvl(b.ydjljf,0)+nvl(b.ljjzjf,0)>500
and a.dhhm=c.dhhm order by zjf desc) ABC)
where rownum<50 ;