oracle 复制表结构及其数据


oracle 复制表结构及其数据


1. 复制表结构及其数据:
 
create table table_name_new as select * from table_name_old
 
2. 只复制表结构:
 
create table table_name_new as select * from table_name_old where 1=2;
 
或者:
 
create table table_name_new like table_name_old
 
 
3. 只复制表数据:
 
如果两个表结构一样:
 
insert into table_name_new select * from table_name_old
 
如果两个表结构不一样:
 
insert into table_name_new(column1,column2...) select column1,column2... from table_name_old

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM