使用Replace 代替Insert
1.设置Table的普通索引
alter table table_name add index index_name (column_list) ;
2.唯一索引
alter table table_name add unique (column_list) ;
3.主键索引
alter table table_name add primary key (column_list) ;
使用 Replace
REPLACE INTO users (id,name,age) VALUES(123, ‘贾斯丁比伯’, 22);
使用Replace及创建索引
521

被折叠的 条评论
为什么被折叠?



