MERGE INTO emp t1 USING ( select count(*) c from emp t2 where t2.empno='2000' )x ON (x.c > 0) when matched then update set t1.job='c++' where t1.empno='1000' when not matched then insert values('3000','zhangs','c',777,sysdate,9000,2,10);
MERGE INTO emp t1 USING ( select count(*) c from emp t2 where t2.empno='2000' )x ON (x.c > 0) when matched then update set t1.job='c++' where t1.empno='1000' when not matched then insert values('3000','zhangs','c',777,sysdate,9000,2,10);