Oracle中复制表结构和表数据详解数据库

一、复制表结构及其数据

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;

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/4145.html

(0)
上一篇 2021年7月16日
下一篇 2021年7月16日

相关推荐

发表回复

登录后才能评论