17,377
社区成员
发帖
与我相关
我的任务
分享
select B.GH,nvl(b.sfzh,b.jbxx_zjhm) as sfzh,b.gmc,b.jbxx,b.xm, b.xx_xb,b.xx_nl,b.xx_khjb,c.WH_XM,a.jydm,a.jymc,a.jyje,a.cq from
cxjylsb_ls a,
hxb_and_zb b,
gryxxt_jbxxb c
where (nvl(b.sfzh,b.jbxx_zjhm)=c.jd_zjhm(+) and nvl(b.sfzh,b.jbxx_zjhm)=a.sfzh(+))
and (substr(a.jysj,1,10)>='2017-04-15' and substr(a.jysj,1,10)<='2017-04-22')
and jymc is not null
and (case when jymc in
('01','02','03','04','05') then -jyje
else jyje
end)
group by B.GH,nvl(b.sfzh,b.jbxx_zjhm) as sfzh,b.gmc,b.jbxx,b.xm, b.xx_xb,b.xx_nl,b.xx_khjb,c.WH_XM,a.jydm,a.jymc,a.jyje,a.cq;