在oracle中如何復制表結構和表數據


1、復制表結構及其數據:

create table table_new as select * from table_old

2、只復制表結構:

create table table_new as select * from table_old where 1=2;

或者

create table table_new like table_old

3、只復制表數據:

如果兩個表結構一樣:

insert into table_new select * from table_old

如果兩個表結構不一樣:

insert into table_new(column1,column2...) select column1,column2... from table_old

pasting


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM