MySQL批量更新

REPLACE INTO users(id,username,birthday,sex,address) VALUES(25,'tom','2011-11-11',2,'杭州'),(26,'李四','2010-10-10',1,'石家庄');
INSERT INTO users(id,username,birthday,sex,address) VALUES(25,'tom','2011-11-11',2,'杭州1'),(26,'李四','2010-10-10',1,'石家庄1') ON
DUPLICATE KEY UPDATE username=VALUES(username),birthday=VALUES(birthday),sex=VALUES(sex),address=VALUES(address)

posted @ 2018-11-12 17:57  annofyf  阅读(96)  评论(0编辑  收藏  举报