Monday, July 10, 2006

Merge statement

merge into copy_emp c
using emp e on(c.empno=e.EMPNO)
when matched then
update
set
c.ename=e.ENAME,
c.deptno=e.DEPTNO
when not matched then
insert values(e.EMPNO,e.ENAME,e.JOB,e.MGR,e.HIREDATE,e.SAL,e.COMM,e.DEPTNO)

No comments:

Post a Comment