时间:2021-07-01 10:21:17 帮助过:8人阅读
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 ---------- ---------- 1 a 2 b 3 c 4 d 5 e 6 f 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. |