Oracle 语法 存在则更新不然插入新数据

merge into my_table  mt 
     using (SELECT  [字段A]  AS  A  from dual) t2  
           on (mt.A = t2.A)
     when matched then  
          update set mt.B= [字段B]
     when not matched then  
          INSERT (A,B)
          VALUES([字段A],[字段B])spa

多用于存储过程table

相关文章
相关标签/搜索