“INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”

后端 未结 12 2479
孤街浪徒
孤街浪徒 2020-11-21 04:30

While executing an INSERT statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear

12条回答
  •  别那么骄傲
    2020-11-21 05:21

    ON DUPLICATE KEY UPDATE is not really in the standard. It's about as standard as REPLACE is. See SQL MERGE.

    Essentially both commands are alternative-syntax versions of standard commands.

提交回复
热议问题