把自己哄清楚了
就什么都好了
|

林汉州win

园龄:5年10个月粉丝:0关注:1

merge into

begin
merge into emp_test a using emp b on (a.empno=b.empno)
when matched then
update set a.comm=b.comm

when not matched then
insert values(b.empno,b.ename,b.job,b.mgr,b.hiredate,b.sal,b.comm,b.deptno);
delete from emp_test where empno not in(select empno from emp);
dbms_output.put_line('delete from emp_test where empno not in(select empno from emp)');--目标表存在,原表emp不存在,则删除
commit;
end;

本文作者:林汉州win

本文链接:https://www.cnblogs.com/win1998/p/16111160.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   林汉州win  阅读(84)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
展开