gpt4 book ai didi

mysql - SQL错误:Can't DROP Index_name; check that column/key exists -- occurs multiple times

转载 作者:行者123 更新时间:2023-11-29 19:15:05 24 4
gpt4 key购买 nike

我想对表执行alter命令,create table和alter table命令如下。

CREATE TABLE `xyz` (
`entity_id` int(11) NOT NULL AUTO_INCREMENT,
`masterform_id` int(11) NOT NULL DEFAULT '1',
`app_status` varchar(500) DEFAULT NULL,
`NegativeMarks` decimal(15,5) DEFAULT NULL,
`ActualScore` decimal(15,5) DEFAULT NULL,
`RawScore` decimal(15,5) DEFAULT NULL,
`PANProratedMarks` decimal(15,5) DEFAULT NULL,
`PANNormalizedMarks` decimal(15,5) DEFAULT NULL,
`RRBZoneNormalizedMarks` decimal(15,5) DEFAULT NULL,
`RRBZoneProratedMarks` decimal(15,5) DEFAULT NULL,
`RRBZoneAllocationTempStorage` varchar(200) DEFAULT NULL,
`GraduatePercentage` decimal(15,5) DEFAULT NULL,
`PANAllocationTempStorage` varchar(1500) DEFAULT NULL,
PRIMARY KEY (`entity_id`),
UNIQUE KEY `app_seq_no` (`app_seq_no`),
UNIQUE KEY `ParticipantID` (`ParticipantID`),
UNIQUE KEY `RegistrationNo` (`RegistrationNo`),
KEY `idx_PANNormalizedMarks` (`PANNormalizedMarks`),
KEY `idx_RRBZoneNormalizedMarks` (`RRBZoneNormalizedMarks`)
) ENGINE=InnoDB AUTO_INCREMENT=273252 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC


Alter table xyz
modify column ActualScore decimal(15,5),
modify column app_status varchar(500),
add index CalculatedCategory(CalculatedCategory),
modify column GraduatePercentage decimal(15,5),
modify column NegativeMarks decimal(15,5),
modify column PANAllocationTempStorage varchar(1500),
modify column PANNormalizedMarks decimal(15,5),
modify column PANProratedMarks decimal(15,5),
drop index idx_ParticipantID,
add unique ParticipantID(ParticipantID),
modify column RawScore decimal(15,5),
drop index idx_RegistrationNo,
add unique RegistrationNo(RegistrationNo),
modify column RRBZoneNormalizedMarks decimal(15,5),
modify column RRBZoneProratedMarks decimal(15,5);

我收到此错误:

SQLError:Can't DROP 'idx_ParticipantID'; check that column/key exists

但我已经收到同样的信息 104 次了。您能告诉我为什么我在日志中收到此错误 104 次吗?如果索引不存在,它应该只给出一次错误,如果我错了,请纠正我。

最佳答案

创建表xyz后,您应该创建所需的索引,其中之一是idx_ParticipantID(ParticipantID列上的索引)。但你并没有创建那个,这就是为什么你不能删除它。

但是您可以忽略这些错误,它们对您的数据库没有影响。我建议您阅读here一些关于索引的内容。

关于mysql - SQL错误:Can't DROP Index_name; check that column/key exists -- occurs multiple times,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42779983/

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