Why are 2 rows affected in my `INSERT … ON DUPLICATE KEY UPDATE`?

前端 未结 2 1693
无人共我
无人共我 2020-12-07 19:29

I\'m doing an INSERT ... ON DUPLICATE KEY UPDATE for a PRIMARY KEY in the following table:

DESCRIBE users_interests;
2条回答
  •  -上瘾入骨i
    2020-12-07 20:16

    From the manual:

    With ON DUPLICATE KEY UPDATE, the affected-rows value per row is 1 if the row is inserted as a new row and 2 if an existing row is updated.

提交回复
热议问题