MERGE INTO

MERGE INTO t_um_dic_type t 
   USING (SELECT :dicTypeCode as code, :dicTypeName as name FROM dual) t1 
   ON (t.code = t1.code and t.name = t1.name) 
  WHEN MATCHED THEN 
   UPDATE SET t.type = :type, t."DESC" = :dicTypeDesc 
   WHEN NOT MATCHED THEN 
   INSERT (id,code,name,type,"DESC",dt_create) 
   VALUES (:dicTypeId,:dicTypeCode,:dicTypeName,:type,:dicTypeDesc,:dtCreate)

原文地址:https://www.cnblogs.com/zjlog/p/5580880.html