mysql> select user_id, content_type_id, object_id, count(*) as num
from vote_vote group by user_id, content_type_id, object_id
having num > 1;
+----------+-----------------+-----------+-----+
| user_id | content_type_id | object_id | num |
+----------+-----------------+-----------+-----+
| 25754992 | 961 | 3665767 | 2 |
| 38896810 | 961 | 3733660 | 3 |
+----------+-----------------+-----------+-----+
唯一键显示在“show create table”
中UNIQUE KEY `user_id` (`user_id`,`content_type_id`,`object_id`),
我的问题: 怎么会发生这种情况? 为什么唯一键在这些记录上不起作用?
一些更奇怪的结果:
show create table
输出: