-- 复制全表字段 CREATE TABLE targetTable LIKE sourceTable; INSERT INTO targetTable SELECT * FROM sourceTable;
CREATE TABLE 新表 select * from 旧表 where 1=2
-- 复制可选字段及数据 CREATE TABLE newadmin AS ( SELECT username, password FROM admin ) -- 可以修改字段名及复制数据 CREATE TABLE newadmin AS ( SELECT id, username AS uname, password AS pass FROM admin ) -- 也可以复制一部分数据 CREATE TABLE newadmin AS ( SELECT * FROM admin WHERE LEFT(username,1) = ‘s‘ )