在将数据插入表中时遇到此错误。
错误代码:1054。“字段列表”中的未知列“ 1”
我正在使用 MySQL Server 5.6。* 。
我已经查看了StackOverflow上的很多线程以及Internet上的很多文章,但我仍然不知道如何使该查询对我有用。
我已经尝试过:
PlayerID
值CREATE TABLE IF NOT EXISTS `PLAYERS` (
`PlayerID` INT NOT NULL AUTO_INCREMENT,
`FirstName` VARCHAR(32) NOT NULL,
`LastName` VARCHAR(32) NOT NULL,
`NickName` VARCHAR(32) NOT NULL,
`Gender` CHAR(1) NULL,
`BirthDate` DATE NULL,
`TeamID` INT NULL,
`CountryID` INT NOT NULL,
INDEX `FirstName_idx` (`FirstName` ASC),
INDEX `LastName_idx` (`LastName` ASC),
INDEX `NickName_idx` (`NickName` ASC),
INDEX `TeamID_idx` (`TeamID` ASC),
INDEX `CountryID_idx` (`CountryID` ASC),
PRIMARY KEY (`PlayerID`),
CONSTRAINT `TeamID`
FOREIGN KEY (`TeamID`)
REFERENCES `CSGO`.`TEAMS` (`TeamID`)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `PlayerCountryID`
FOREIGN KEY (`CountryID`)
REFERENCES `CSGO`.`COUNTRIES` (`CountryID`)
ON DELETE CASCADE
ON UPDATE CASCADE)
INSERT INTO `PLAYERS` (`PlayerID`, `FirstName`, `LastName`, `NickName`, `Gender`, `BirthDate`, `TeamID`, `CountryID`)
VALUES (1, 'Fatih', 'Dayik', 'gob b', 'M', '1987-07-10', NULL, 80);
INSERT INTO `PLAYERS` (`PlayerID`, `FirstName`, `LastName`, `NickName`, `Gender`, `BirthDate`, `TeamID`, `CountryID`)
VALUES (2, 'Nikola', 'Ninic', 'LEGIJA', 'M', '1990-11-15', NULL, 216);