如何在Oracle中複製表結構和表數據 【轉載】

 

1. 複製表結構及其數據:html

create table table_name_new as select * from table_name_oldspa

2. 只複製表結構:htm

create table table_name_new as select * from table_name_old where 1=2;blog

或者:get

create table table_name_new like table_name_oldtable

3. 只複製表數據:ast

若是兩個表結構同樣:select

insert into table_name_new select * from table_name_old數據

若是兩個表結構不同:tab

insert into table_name_new(column1,column2...) select column1,column2... from table_name_old

pasting

分類: Oracle 隨

相關文章
相關標籤/搜索