gpt4 book ai didi

mysql - 使用 select : ! 插入 #1062 - key '222-104276' 的重复条目 'cry_id'

转载 作者:行者123 更新时间:2023-11-30 01:18:58 26 4
gpt4 key购买 nike

我有一个下表:

dct_cry_id............cry_id............dct_id......分类......dct_connection_id(...)71.................13.................104276......................... ...70.........02110......................29............104276............ .7.........................02111......................37.......104276............ .8......................02112......................38.......104276............ .6......................0(...)591......................13......154614............ ..540..................02090......................36.......154614............ .46......................02091......................30.......154614............ .2........................0(...)

我使用以下查询

I use following query
INSERT INTO mytabletest1 (cry_id,`dct_id`)
-- VALUES (222)
SELECT
222, `dct_id`

FROM `mytabletest1`
WHERE `cry_id`
NOT IN
(
112, 115, 116, 117, 118,
973, 974, 975, 976, 977,
8
)

不幸的是,我有以下警告/错误消息:

"! #1062 - Duplicate entry '222-104276' for key 'cry_id'"

为什么我收到此消息?

此后,我检查了我的表格,我的查询有效:dct_cry_id............cry_id............dct_id............分类......dct_connection_id(...)71.................13.................104276......................... ...70.........02110......................29............104276............ .7.........................02111......................37.......104276............ .8......................02112......................38.......104276............ .6......................0153876........................222.................104276........................ .0........................0(...)591......................13......154614............ ..540..................02090......................36.......154614............ .46......................02091......................30.......154614............ .2........................015870......................222......154614............ ..0......................0(...)

最佳答案

您的查询将返回键“222-104276”4 次。该记录已插入一次,第二次插入时出现错误。

关于mysql - 使用 select : ! 插入 #1062 - key '222-104276' 的重复条目 'cry_id',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18768733/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com