我正在尝试更新数据库中的字段,一切正常。但是,每当我尝试更新表数据时,我都会收到错误代码“错误代码1054。”“ where子句”中的未知列“ userCertificateID”
CREATE TABLE `userCertificate` (
`userCertificateID` int(11) NOT NULL AUTO_INCREMENT,
`userID` varchar(45) DEFAULT NULL,
`certificatename` varchar(45) DEFAULT NULL,
`organization` varchar(45) DEFAULT NULL,
`location` varchar(45) DEFAULT NULL,
`startdate` varchar(45) DEFAULT NULL,
`enddate` varchar(45) DEFAULT NULL,
PRIMARY KEY (`userCertificateID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
UPDATE userExperience
SET certificatename = 'PMPPP'
, organization = 'hello'
, location = 'Canada'
, startdate = '2019-12-31'
, enddate = '2019-12-31'
WHERE userCertificateID = 4
在mysql中,它强调了组织并说:“组织在此位置无效,需要一个标识符。
答案 0 :(得分:0)
您正在更新错误的表,请尝试:
UPDATE userCertificate
SET certificatename = 'PMPPP'
, organization = 'hello'
, location = 'Canada'
, startdate = '2019-12-31'
, enddate = '2019-12-31'
WHERE userCertificateID = 4