mysql

添加唯一约束

ALTER TABLE account add unique(name);

复制表结构及数据 create table new_table select * form old_table;

只复制表结构 create table new_table select * from old_table where 1=2;

create table new_table like old_table;

复制数据(结构一致) insert into new_table select * from old_table;

复制数据(结构不一致) insert into new_table(col1, col2, ...) select col1, col2 ... from old_table;