0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

INSERT ... ON DUPLICATE KEY UPDATE 構文なのに、カラムが増える

Posted at

結論

  • auto-increment と相性が悪いため、必要なければ設定しない。

原因

  • MySQL は INSERT 時点で、auto-increment が走り、その差分が次の処理(UPDATE)へ受け継がれてしまう。← ??
  • auto-increment が必要ないならば、そのカラムを削除する。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?