gpt4 book ai didi

mysql - SQLSTATE[23000] : Integrity constraint violation: 1062 Duplicate entry 'xxx' for key 'group_key'

转载 作者:行者123 更新时间:2023-11-29 08:13:05 27 4
gpt4 key购买 nike

在我的网页上没有插入或更新,但我已经收到此错误:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-Bekoo-2449.10' for key 'group_key'

这令人惊讶,因为网页不会修改任何行,并且 Product 表没有 group_key 列或键。

我的查询:

SELECT Product._like,
comment_count,
title,
price_lower,
price,image,
AffiliateOffers.name,
p‌​‌​ayout_yuzde,
payout_nakit,
payout_type,
xml_id,
brand,model,
currency,url,
Product.af‌​f_‌​id,
Product.offer_id,
pb_share_1,
pb_share_2,
pb_share_1_payda,
pb_share_2_payda,
A‌​ffil‌​iateOffers.seo_title,
afo_offer_id,
r_category,
seo_description
FROM Product
inner Join AffiliateOffers on Product.aff_id = AffiliateOffers.af_id
AND Product.offer_id = AffiliateOffers.af_offer_id
where Product.status = 1
and Product.aff_id = 1
and Product.offer_id = 1290

和我的表结构:

` CREATE TABLE `_product` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`xml_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`aff_id` int(11) NOT NULL,
`offer_id` int(11) NOT NULL,
`r_category` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`category_id1` int(11) NOT NULL,
`category_id2` int(11) NOT NULL,
`category_id3` int(11) NOT NULL,
`brand` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`model` varchar(75) COLLATE utf8_unicode_ci DEFAULT NULL,
`title` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`description_1` mediumtext COLLATE utf8_unicode_ci,
`price` decimal(18,2) NOT NULL,
`price_lower` decimal(18,2) NOT NULL,
`percentage_lower` int(11) NOT NULL,
`image` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`url` text COLLATE utf8_unicode_ci,
`feature` tinyint(4) NOT NULL,
`city` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
`sex` tinyint(4) NOT NULL,
`stock` tinyint(4) NOT NULL,
`start_date` int(25) NOT NULL,
`finish_date` int(25) NOT NULL,
`update_date` int(25) NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT '1',
`hit` int(11) NOT NULL DEFAULT '1',
`_like` int(11) NOT NULL DEFAULT '0',
`comment_count` int(11) DEFAULT NULL,
`like_count` int(11) DEFAULT NULL,
`lastlike_time` int(25) DEFAULT NULL,
`visit_count` int(11) DEFAULT NULL,
`lastvisit_count` int(25) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `xml_id` (`xml_id`),
KEY `lastlike_time` (`lastlike_time`),
KEY `offer_id` (`offer_id`),
KEY `r_category` (`r_category`),
KEY `status` (`status`)
) ENGINE=MyISAM AUTO_INCREMENT=3816867 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci`

为什么我会收到此错误?

最佳答案

除非您另有说明,group_key 是 MySQL 在聚合内容时使用的内部字段,因此您不会在自己的表或 View 中找到它。那里的重复条目错误意味着您的聚合出现了某种问题。

查看您正在使用的任何 GROUP BY 语句,并确保其语法正确,尤其是在任何聚合函数和组表达式中。

关于mysql - SQLSTATE[23000] : Integrity constraint violation: 1062 Duplicate entry 'xxx' for key 'group_key' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21185241/

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