使用merge
merge into 表名 t1 using (select '数据数据' 字段1,'数据数据' 字段2 from dual) t2 on (t1.字段1 = t2.字段1) when matched then update set t1.字段2= t2.字段2 when not matched then insert values (t2.字段1, t2.字段2)
使用merge
merge into 表名 t1 using (select '数据数据' 字段1,'数据数据' 字段2 from dual) t2 on (t1.字段1 = t2.字段1) when matched then update set t1.字段2= t2.字段2 when not matched then insert values (t2.字段1, t2.字段2)