键"group_key"的条目重复 [英] Duplicate entry for key 'group_key'
问题描述
我正在MySQL中运行查询,在其中我按四列进行分组并选择很多东西,包括按分组的四个值.但是运行查询时出现此错误:
I'm running a query in MySQL where I'm grouping by four columns and selecting a lot of things, including the four values I'm grouping by. But I get this error when I run the query:
Duplicate entry '92-0-10-7' for key 'group_key'
92、0、10和7都是特定行的四个分组列的值(实际上,我检查过,有63行适合这些参数).但是我不知道这是什么意思,或者如何正确运行查询.
The 92, 0, 10, and 7 are all values of the four grouped-by columns for a particular row (actually, I checked, and there are 63 rows that fit those parameters). But I have no idea what that means, or how to run my query properly.
我的查询:
Create table table2 as
Select round(x, 0) as x, round(a, 0) as a, round(b, 0) as b, c, d, e, f
from table1
group by round(x, 0), round(a, 0), round(b, 0), c
92将适合x,0 a,10 b和7 c.
The 92 would fit x, the 0 a, the 10 b, and the 7 c.
我在这张桌子上没有索引.
I have no indices on this table.
谢谢!
推荐答案
您的问题似乎是一个MySQL错误.前几天,我正在查看生产服务器的日志,并且错误日志中充满了此错误.我使用下面的解决方法,错误消失了.
Your issue seems like a MySQL bug. I was reviewing the logs for our production server the other day and the error logs were filled with this error. I used the workaround below and the errors are gone.
SET SESSION max_heap_table_size = 536870912;
SET SESSION max_heap_table_size=536870912;
SET SESSION tmp_table_size = 536870912;
SET SESSION tmp_table_size=536870912;
来源: http://bugs.mysql.com/bug.php?id= 58081
这篇关于键"group_key"的条目重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!