标签:mysql复制 ike int uname 修改字段 select pre 数据 字段名
-- 复制全表字段 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‘ )
标签:mysql复制 ike int uname 修改字段 select pre 数据 字段名
原文地址:https://www.cnblogs.com/pastjx/p/12990747.html