merge into table t1 using (select '123' ID,'aa' Name from dual) t2 on (t1.ID = t2.ID) when matched then update set t1.Name = t2.Name when not matched then insert values (t2.ID, t2.Name); commit;
oracle表中存在数据就修改,没有数据自动添加 的sql语句
最新推荐文章于 2023-03-17 16:45:58 发布
本文提供了一个SQL脚本示例,演示了如何使用MERGE语句将数据从一个临时表合并到另一个表中。当目标表中有匹配的记录时进行更新,没有则插入新记录。

2018

被折叠的 条评论
为什么被折叠?



