sql复制一张表 包含数据和不包含数据

2020-11-27  本文已影响0人  flyjar

「拷贝表」

//不会将索引也复制

//where 1=1 写不写都可以

create table table_name  as  select  *  from  Source_table  where  1=1;

create table table_name  as  select  *  from  Source_table;

「复制表结构」

//不会将索引也复制

create table table_name  as  select  *  from  Source_table  where  1 <> 1;

上一篇 下一篇

猜你喜欢

热点阅读