create table as与create table like

create table select: 会将原表中的数据完整复制一份,但表结构中的索引会丢失。主要用于备份数据。

例如:create table student_like like student;

create table like: 只会完整复制原表的建表语句,但不会复制数据。主要用于创建表。

例如:create table student_as as SELECT * from student;

 

猜你喜欢

转载自guwq2014.iteye.com/blog/2393345