首页 > 代码库 > oracle 表复制

oracle 表复制

oracle 表复制

1>create table ... as select ..,表不存在的情况下,创建表并且复制数据。oralce中表不存在的情况下用此语句。

create table newTable as select * from soruceTable

2>insert into ...select from...,表存在的情况下,复制数据,oracle中可以用此语句复制数据。

insert into targetTable(value11,value12..) select from value21,balue22 from sourceTable

3>select ...into  ... from ..,表不存在的情况下,创建表并且复制数据,在plsql中直接运行会报错,需要再块中运行。

select value11,value12... into newTable from sourceTable

 

 

转载自:http://www.cnblogs.com/guohu/articles/2744481.html