1.复制表结构及其数据
create table tableName as select * from otherTable.
2.只复制表结构
create table tableName as select * from tableName where 1=2;
or create table tableName like tableName_old.
3.只复制表数据
表结构相同:insert into table_new select * from table_old
表结构不相同:insert into table_new (column1,column2) select column1,column2 from table_old
create table tableName as select * from otherTable.
2.只复制表结构
create table tableName as select * from tableName where 1=2;
or create table tableName like tableName_old.
3.只复制表数据
表结构相同:insert into table_new select * from table_old
表结构不相同:insert into table_new (column1,column2) select column1,column2 from table_old