更新时间:2022-05-21 02:56:29
其官方语法是
INSERT IGNORE ...
但是,在您的情况下,这样做实际上更可取
However, in your case it may actually be preferable to do
INSERT ... ON DUPLICATE KEY UPDATE id=id
See benchmarks. In my experience, this hack only improves performance if you've got a primary key--the optimizer won't recognize the no-op if you do follower_id = follower_id
.