在Oracle数据库中复制表结构和表数据

1. 复制表结构及其数据:

create table new_table as select * from old_table

2. 只复制表结构:

create table new_tableas select * from old_tablewhere 1=2;

或者:

create table new_table like old_table

3. 只复制表数据:

如果两个表结构一样:

insert into new_table select * from old_table

如果两个表结构不一样:

insert into new_table (column1,column2...) select column1,column2... from old_table

pasting

猜你喜欢

转载自blog.csdn.net/qq_32641813/article/details/83623573