This shows you the differences between two versions of the page.
— |
kurs:delete_truncate_drop [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | select * from emp_copy; | ||
+ | delete from emp_copy where employee_id in (SELECT EMP_COPY.EMPLOYEE_ID | ||
+ | FROM EMP_COPY , DEPARTMENTS | ||
+ | WHERE ( (EMP_COPY.DEPARTMENT_ID = DEPARTMENTS.DEPARTMENT_ID) AND | ||
+ | (DEPARTMENTS.DEPARTMENT_NAME = 'IT') )) | ||
+ | |||
+ | select * from employees | ||
+ | minus | ||
+ | select * from emp_copy | ||
+ | |||
+ | |||
+ | create table emp_tmp as select * from emp_copy | ||
+ | drop table emp_tmp; | ||
+ | truncate table emp_copy | ||
+ | select * from emp_copy | ||
+ | insert into emp_copy select * from employees | ||
+ | </code> |