首页 > > > 如何插入? | 非开车,纯技术交流
简单插入(simple insert)
批量插入(bulk insert)
混合插入(mixed-mode insert)
insert into t1(id, name) values(1,"shenjian");
insert into t1(name) values("zhangsan"),("lisi"),("ww");
insert into t1(name) select name from t2;
replace … select …
load data
InnoDB assigns new values for the AUTO_INCREMENT column one at a time as each row is processed.
insert into t1(id, name) values (111,"111"),(NULL, "abc"),(222,"222"),(NULL,"xyz");
insert into t1(name) values("shenjian"),("aaa"),("bbb")
on duplicate key update count=100;
an INSERT followed by a UPDATE, where the allocated value for the AUTO_INCREMENT column may or may not be used during the update phase.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31556838/viewspace-3140907/ ,如需转载,请注明出处,否则将追究法律责任。