merge 对表新增或者修改

 
merge into ITIL_REPORT_DEVICE rd
using (select 1 from dual)
on (rd.id = '3d42e973-470a-48b8-ae01-729b417461e6')
when matched then
  update set rd.reportName = 'kaka'
when not matched then
  insert values ('666', 'name', sysdate, 'id_admin', '2', 'sss', '1', '');

你可能感兴趣的:(merge)