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 1 year has passed since last update.

「Duplicate entry ‘1’ for key ‘PRIMARY’」とSQLでエラー表示されるとき 

Posted at

SQLでデータの更新をかけようとすると、下記のエラーが発生

ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'

意味

キーが重複している.
すでにそのデータが存在している時などに出力されるエラー。

対応策

更新使用としているデータを別の値にしてあげる。
また自動入力されるカラムの場合は、nullにして上げる自動で入力でされる。

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?