17,382
社区成员




select a.1,b...... from biao a,biao b,biao c
where nvl(b.sfzh,b.jbxx_zjhm)=c.jd_zjhm(+) and nvl(b.sfzh,b.jbxx_zjhm)=(select e.zjhm from biao d,biao e where d.cb=e.cb)(+)
and ......
with t as
(select e.zjhm
from yw_jfgl_cxjylsb_ls d, yw_jfgl_zhdzb e
where d.ZHKHYBT = e.NBZH)
select a.jgh,
a.jydm,
a.jymc,
a.cq,
a.khrq,
a.jyrq,
a.dqrq,
(case
when jydm in ('070603',
'070604',
'070404',
'070203',
'070204',
'070503',
'070504',
'070613') then
-jyje
else
jyje
end) as jy,
nvl(b.jbxx_gsjgh, b.gsjgh) as gsjgh,
b.bzjgmc,
nvl(b.sfzh, b.jbxx_zjhm) as sfzh,
b.jbxx_sskhq,
b.khxm,
b.jbxx_xb,
b.jbxx_nl,
b.jbxx_vipklx,
c.WH_KHJLXM,
c.JD_QH_SHENG,
c.JD_QH_SHI,
c.JD_QH_XIANQU,
c.JD_QH_ZHEN,
c.jd_dz
from lsb_ls a, j_and_hzb b, xxt_jdxxb c
where nvl(b.sfzh, b.jbxx_zjhm) = c.jd_zjhm(+)
and nvl(b.sfzh, b.jbxx_zjhm) = t.zjhm(+)
and a.jymc is not null
and a.jydm in ('070601',
'070602',
'070603',
'070604',
'070401',
'070404',
'070201',
'070202',
'070203',
'070204',
'070501',
'070503',
'070504',
'070612',
'070613')
and (substr(a.jysj, 1, 10) >= '2017-05-01' and
substr(a.jysj, 1, 10) <= '2017-05-20');
select a.jgh,a.jydm,a.jymc,a.cq,a.khrq,a.jyrq,a.dqrq,(case when jydm in ('070603','070604','070404','070203','070204','070503','070504','070613')
then -jyje
else jyje end) as jy,nvl(b.jbxx_gsjgh,b.gsjgh) as gsjgh,b.bzjgmc,nvl(b.sfzh,b.jbxx_zjhm) as sfzh,b.jbxx_sskhq,b.khxm, b.jbxx_xb,b.jbxx_nl,b.jbxx_vipklx,c.WH_KHJLXM,c.JD_QH_SHENG,c.JD_QH_SHI,c.JD_QH_XIANQU,c.JD_QH_ZHEN,c.jd_dz from
lsb_ls a,
j_and_hzb b,
xxt_jdxxb c
where (nvl(b.sfzh,b.jbxx_zjhm)=c.jd_zjhm(+) and
nvl(b.sfzh,b.jbxx_zjhm)=(select e.zjhm from yw_jfgl_cxjylsb_ls d,yw_jfgl_zhdzb e where d.ZHKHYBT=e.NBZH)(+)
and a.jymc is not null
and a.jydm in ('070601','070602','070603','070604','070401','070404','070201','070202','070203','070204','070501','070503','070504','070612','070613')
and (substr(a.jysj,1,10)>='2017-05-01' and substr(a.jysj,1,10)<='2017-05-20');
完整脚本