MySQL 基础六 临时表 复制表结构

1.临时表
CREATE TEMPORARY TABLE test2( id INT ) SELECT
*FROM test2 SHOW TABLES; INSERT INTO test2 VALUES(1) DROP TABLE test2

2.复制表结构(先show create table test 获取 sql,然后用sql创建新表)

3.复制表的数据到新创建的表
INSERT INTO test2 SELECT
*FROM test
天生我材必有用,千金散尽还复来
原文地址:https://www.cnblogs.com/ligenyun/p/8183156.html