您的位置:首页 > 数据库 > Oracle

Oracle中复制表结构和表数据

2014-01-09 14:42 99 查看
一、复制表结构及其数据

create table new_table as (select * from old_table);


二、只复制表结构

create table new_table as (select * from old_table where 1=2);


三、只复制表数据

如果两个表结构一样:

insert into new_table select * from old_table;


如果两个表结构不一样:

insert into new_table(column1,column2...) select column1,column2... from old_table;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: