ora01747

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

   insert into MR_MSG_XZBKMX_RES_BKXX(ID,MSGID,HH,HM,   DZ,BW,BCH,
    BWH,KJ,BSH,   SQXZ,SQCBR,HBSL,
    ZDDS,RJSL,LSSL,   QSL1,QSL2,QSL3,
    DJ,HHYS,YSXZMS,   RKS,CBZQ,SFLX,
    LXDH,ZBRQ,QFSL,   QFJE,QFBS,DKZHYE,
    SQDBDS,YSKYE,TSXX,   MS1,MS2,MS3,
    MS4,MS5,CBSXH, BKSXH)   
   select SEQ_MR_MSG_XZBKMX_RES_BKXX.nextval, pinmsgid,x.HH,x.HM,  x.DZ,x.BW,x.BCH,
    x.BWH,x.KJ,x.BSH,   x.SQXZ,x.SQCBR,x.HBSL,
    decode(x.ZDDS,0,v_zdds,x.ZDDS),x.RJSL,case when v_lssllx=1 then x.qsl1 else x.pjsl end,   x.QSL1,x.QSL2,x.QSL3,
    x.DJ,x.HHYS,x.YSXZMS,   x.RKS,x.CBZQ,x.SFLX,
    x.LXDH,x.ZBRQ,x.QFSL,   x.QFJE,x.QFBS,x.DKZHYE,
    x.SQDBDS,x.YSKYE,x.TSXX,   x.MS1,x.MS2,x.MS3,
    x.MS4,x.MS5,x.CBSXH,  rownum   from
(select a.hh,
 a.bzmc HM,
 a.yhdz DZ, 
 a.zbwz BW,
 a.bch, 
 a.bwh,
 f.kj, 
 f.bsh,
 NVL(g.xbqd,d.sqxz) SQXZ,  
 d.sqcbr,
 0 hbsl,
 f.zdds zdds,
 -1 rjsl,        
 d.pjsl,
 d.qsl1,d.qsl2,d.qsl3,
 a.zysxz,
 h.dj,
 case when a.ysxzsl=1 then 0 else 1 end hhys, 
 h.xzms YSXZMS,
 a.ysrk RKS,
 a.cbzq,
 i.sflx,
 i.lxdh,         
 k.zbrq,
 0 QFSL, 
 0 QFJE,
 0 QFBS,
 0 dkzhye,   
 0 sqdbds,     
 NVL(i.yskye,0) yskye,   
 null tsxx,                    
 null ms1,
 null ms2,
 null ms3,
 null ms4,
 null ms5,
 d.cbsxh
from da_yhbk@o3mislink  a
   full join da_cbxx@o3mislink  d on a.hh = d.hh
   full join sb_sbda@o3mislink  f on f.sbid = a.sbid
   full join da_khxx@o3mislink  i on i.khh = a.khh
   full join da_lhxx@o3mislink  k on k.hh = a.hh
   full join da_dm_yhzt@o3mislink  c on a.yhzt = c.ztid and c.sfcb = 1
   left join mr_gps n on a.hh=n.hh
   left join (select x.hh,x.xbqd
      from cb_chrw@o3mislink  x,
           (select a.hh,max(a.sgrq) sgrq from cb_chrw@o3mislink  a,da_yhbk@o3mislink  c
            where (v_bchs like '%'||c.bch||',%') and a.hh=c.hh and a.jsbz=1
            group by a.hh) y
      where x.hh = y.hh and x.sgrq = y.sgrq) g on g.hh = a.hh
   full join (select ysxz,dj,xzms from fy_ysxz@o3mislink
                where v_sfyf between sxrq and nvl(jsrq,v_sfyf)
             ) h on a.zysxz = h.ysxz
   left join cb_slb@o3mislink  e on a.hh = e.hh and e.jgbz in (0,1,2,4,6,7) and e.sfyf = v_sfyf
where v_bchs like '%'||a.bch||',%'
and MOD(EXTRACT(month from trunc(v_sfyf,'MM')),a.CBZQ)=MOD(a.QCY,a.CBZQ)
and e.hh is null
order by a.bch,d.cbsxh
   ) x;