首页 > 代码库 > MySQL创建相同表和数据命令

MySQL创建相同表和数据命令

创建和表departments结构和数据一样的表departments_t

mysql> create table departments_t like departments;

Query OK, 0 rows affected (1.61 sec)

 

mysql> insert into departments_t select * from departments;

Query OK, 9 rows affected (0.53 sec)

Records: 9  Duplicates: 0  Warnings: 0

MySQL创建相同表和数据命令