原句子
1merge into dept a using dept_bak b on (a.deptno=b.deptno)
when matched then
update set a.dname=b.dname,
a.loc=b.loc
when not matched then
insert (deptno,dname,loc)values(b.deptno,b.dname,b.loc);//这里字段不需要标记表别名
然后使用dblink
merge into dept a using dept@link_orcl b on (a.deptno=b.deptno)
when matched then
update set a.dname=b.dname,
a.loc=b.loc
when not matched then
insert (deptno,dname,loc)values(b.deptno,b.dname,b.loc);
哈哈是不是超级简单,按理说dblink也可以放前面,那就是改动对方的表了,回去试试