drop table c_emp purge;
create table c_emp
as
select * from emp where 1=2;
select * from c_emp;
insert into c_emp
select *
from emp;
select * from c_emp;
↓ ↓ ↓
drop table c_emp purge;
select * from c_emp;
create table c_emp
as
select * from emp;
cf.) 특정 컬럼만 복사하고 컬럼 이름 변경하여 테이블 생성
drop table p_emp purge;
create table p_emp
as select empno as emp_no, ename, sal as salary, deptno
from emp;
desc p_emp
select * from p_emp;
'Oracle > SQL Fundamentals I' 카테고리의 다른 글
10일차 # 8-18: DELETE Statement (0) | 2012.04.17 |
---|---|
10일차 # 8-13: UPDATE (0) | 2012.04.17 |
10일차 # 8-10: 치환변수를 이용한 insert (0) | 2012.04.17 |
10일차 # 8-7: Insert 수행시 발생하기 쉬운 오류들 (0) | 2012.04.17 |
10일차 # 8-6: Inserting a row (0) | 2012.04.17 |