【发布时间】:2016-12-10 18:04:10
【问题描述】:
我需要一些关于我的 SQL 代码的帮助:
insert into '.$type.' select * from ' .$type.' where effective_id = '.$id
但我收到此代码错误。
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3' for key 'PRIMARY' (SQL: insert into actionplan select * from actionplan where effective_id = 3)
任何想法如何跳过 id 列?我必须在几个表上使用此代码。所以我不能写所有的列。
【问题讨论】:
-
什么 DBMS?这因特定的 SQL 产品而异。
-
根据错误信息添加
mysql标签
标签: mysql sql select insert auto-increment