MySQL 报Duplicate entry xxx for key '<group_key>'
错误
1.报错
mysql> select shop_id,bd_code,gmt_create from e_sos_shop_bd_log group by shop_id,bd_code,gmt_create having count(1) > 1;
ERROR 1062 (23000): Duplicate entry '115603-GSHF1167-2018-12-07 12:02:10' for key '<group_key>'
这个报错的奇怪之处在于,执行上述这个SQL 是在使用 select,而不是 insert,竟然会报Duplicate entry
错误。十分不解。
2.原因
- 原因没有找到
3.示例
4.参考文章
- https://bugs.mysql.com/bug.php?id=82544