平常写SQL语句,会经常用到如此:
1、既复制表结构也复制表内容的SQL语句:CREATE TABLE tab_new AS SELECT * FROM tab_old;
2、只复制表结构不复制表内容的SQL语句:CREATE TABLE tab_new AS SELECT * FROM tab_old WHERE 1=2;
1、既复制表结构也复制表内容的SQL语句:CREATE TABLE tab_new AS SELECT * FROM tab_old;
2、只复制表结构不复制表内容的SQL语句:CREATE TABLE tab_new AS SELECT * FROM tab_old WHERE 1=2;