CREATE UNIQUE INDEX 终止,因为发现了索引 ID 1 的重复键。最重要的主键为 '103280021'。我以为是表里有重复的记录,但用下面两条语句查询了一下,两条语句返回的结果是一样的,表里没有重复记录,为什么也会出错
select count(*) from kq_record where xuehao='103280021'
select count(*) from (select distinct * from kq_record where xuehao='103280021')
select count(*) from kq_record where xuehao='103280021'
select count(*) from (select distinct * from kq_record where xuehao='103280021')
select count(*) from (select distinct xuehao from kq_record where xuehao='103280021')
这样是多少?
看看 有没summ=2的
想在xuehao,readdate上设主键
可却出现上面的错误
想在xuehao,readdate上设主键 |?????不是索引
--去掉重复索引
delete sysindexes where id=...
WHERE xuehao='0780280053'
GROUP BY ReadDate,xuehao
HAVING COUNT(*)>1解决了,谢谢大家
真的有重复记录