oracle 通过查询灵活插入数据

insert into prplclaimtoplatformfail
  (CLAIMCODE,
   REQUESTTYPE,
   CLAIMTYPE,
   COMFLAG,
   REGISTNO,
   CLAIMNO,
   POLICYNO,
   COMPENSATENO,
   RISKCODE,
   CONFIRMSEQUENCENO,
   COMCODE,
   INSUREDKINDCODE,
   LASTFAILTIME,
   LASTFAILREASON,
   INPUTTIME,
   INSERTTIMEFORHIS,
   OPERATETIMEFORHIS)
  select f.registno,
         'case4',
         CASE WHEN f.riskcode = '0360' THEN 'B' WHEN f.riskcode = '0331' THEN 'C' END,
         'Z',
         f.registno,
         null,
         f.policyno,
         f.registno,
         f.riskcode,
         b.CONFIRMSEQUENCENO,
         '04010101',
         null,
         to_date('29-05-2017 19:58:24', 'dd-mm-yyyy hh24:mi:ss'),
         null,
         to_date('29-05-2017', 'dd-mm-yyyy'),
         to_date('29-05-2017 19:58:24', 'dd-mm-yyyy hh24:mi:ss'),
         to_date('29-05-2017 19:58:24', 'dd-mm-yyyy hh24:mi:ss')
    from prplclaim a, prplclaim0531 f,prplclaimtoplatformmain b
   where a.caseno is not null
     and a.registno like 'R04%'
     AND A.CASETYPE = '2'
     AND A.SUMPAID <> 0
     and f.claimno = a.claimno
     and b.registno = f.registno
   order by a.endcasedate;
   

你可能感兴趣的:(沉淀人生)