oracle复制表sql

来源:互联网 发布:班班通软件下载 编辑:程序博客网 时间:2024/06/06 22:31
1.复制表结构

create table b as select * from a where 1<>1


2.复制表结构和数据

create table b as select * from a


3.复制指定的字段

create table b as select row_id,name,age from a where 1<>1


4.复制表的指定字段及这些指定字段的数据

create table b as select row_id,name,age from a


5.复制一个表的数据到另一个已存在的表里

Insert into Table2(field1,field2) select value1,value2 from Table1


6.复制一个表到一个新表里(目标表table2不存在,插入时候会自动创建表table2)
SELECT vale1, value2 into Table2 from Table1
原创粉丝点击