摘要: mysql中insert into和replace into以及insert ignore用法区别:mysql中常用的三种插入数据的语句:insert into表示插入数据,数据库会检查主键,如果出现重复会报错;replace into表示插入替换数据,需求表中有PrimaryKey,或者unique索引,如果数据库已经存在数据,则用新数据替换,如果没有数据效果则和insert into一样;insert ignore表示,如果中已经存在相同的记录,则忽略当前新数据;下面通过代码说明之间的区别,如下:create table testtb(id int not null primary key 阅读全文
posted @ 2011-09-28 01:34 Glawind 阅读(22380) 评论(1) 推荐(2) 编辑