MERGE 사용 예

 

SQL> merge into professor p

   2   using professor temp f

   3   on (p.profno = f.profno)

   4   when matched then

   5   update set p.position = f.position

   6   when not matched then

   7   insert values(f.profno, f.name, f.userid, f.position, f.sal, f.hiredate, f.comm, f.deptno);

 

3 rows merged.

 

SQL> select * from professor;

9 rows selected.

 

 

 

+ Recent posts