很简单的方法,可以略过。


需求:

在test库下创建表,要求导入hellodb.students的数据。


方法1:

use test;

create table t2 as select * from hellodb.students;


方法2:

use test;

create table t1 like hellodb.students;

insert into t1 select * from hellodb.students;


方法2的效果更好,具体可以看下图。

wKiom1jvhW-CrbJkAACBQBi-2qA352.png