复制表结构
CREATE TABLE empty_table_name LIKE table_name;
根据table_name创建一个空表empty_table_name,empty_table_name没有任何数据。
SQL Server中,如果目标表存在:
1
|
insert into 目标表 select * from 原表;
|
SQL Server中,,如果目标表不存在:
1
|
select * into 目标表 from 原表;
|
Oracle中,如果目标表存在:
1
2
|
insert into 目标表 select * from 原表;
commit ;
|
Oracle中,如果目标表不存在:
1
|
create table 目标表 as select * from 原表;
|