1.创建表T并初始化测试数据,此表作为数据源。
sec@ora10g> create table t (x number(10), y varchar2(10)); sec@ora10g> insert into t values (1,'a'); sec@ora10g> insert into t values (2,'b'); sec@ora10g> insert into t values (3,'c'); sec@ora10g> insert into t values (4,'d'); sec@ora10g> insert into t values (5,'e'); sec@ora10g> insert into t values (6,'f'); sec@ora10g> commit; |
2.查看表T的数据
sec@ora10g> select * from t; X Y 6 rows selected. |
3.创建表T1和T2,作为我们要插入的目标表。
sec@ora10g> create table t1 as select * from t where 0=1; Table created. sec@ora10g> create table t2 as select * from t where 0=1; Table created. |