oracle merge into用法(R1)

thamsyangsw發表於2014-02-28
merge /*+parallel(16)*/
into j1_ldm.LDMT02_YE_FPXX A
USING HX_DEL.FP_NSRFPJC_DEL B
ON (
       a.nsrzhdah = 'G3'||b.DJXH
       and a.ywxh = 'G3'||b.NSRJCUUID
       and B.deal_date >= '2014-02-10 00:00:00.000000000' 
       and B.deal_date <= '2014-02-28 00:54:55.000000000')
WHEN MATCHED THEN
  UPDATE
     SET A.sjscrq = to_char(trunc(to_timestamp(B.deal_date, 'yyyy-mm-dd hh24:mi:ss.ff')),'yyyymmdd'),
            a.sjbgbz = 'D';

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26613085/viewspace-1097118/,如需轉載,請註明出處,否則將追究法律責任。

相關文章