mysql 添加外键失败 #1072 - Key column 'agentnumber' doesn't exist in table
createTABLE`agent`.`userlist`(`username`VARCHAR(20)NOTNULL,`password`VARCHAR(20)NOTNU...
create TABLE `agent`.`userlist` (
`username` VARCHAR( 20 ) NOT NULL ,
`password` VARCHAR( 20 ) NOT NULL ,
`guiding question` VARCHAR(100 ) NULL ,
`guiding answer` VARCHAR( 50 ) NULL ,
`location` int NOT NULL ,
foreign key( `agentnumber` ) references `agentlist`( `agentnumber` ) on update cascade,
PRIMARY KEY ( `username` )
) ENGINE = MYISAM
请问问题在哪里?如何解决?谢谢 展开
`username` VARCHAR( 20 ) NOT NULL ,
`password` VARCHAR( 20 ) NOT NULL ,
`guiding question` VARCHAR(100 ) NULL ,
`guiding answer` VARCHAR( 50 ) NULL ,
`location` int NOT NULL ,
foreign key( `agentnumber` ) references `agentlist`( `agentnumber` ) on update cascade,
PRIMARY KEY ( `username` )
) ENGINE = MYISAM
请问问题在哪里?如何解决?谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询