gpt4 book ai didi

mysql - 错误: Unknown column 'makeId' in 'field list'

转载 作者:行者123 更新时间:2023-11-29 12:36:07 25 4
gpt4 key购买 nike

当我使用INSERT从表中获取信息并将其放入vehicleNormal时,我不断在“字段列表”中收到未知列“makeId”。

INSERT INTO vehicleNormal (makeId, modelId, year, cylinders, driveId, mpgHighway, mpgCity, fueltypeId)
(SELECT makeId, modelId, year, cylinders, driveId, mpgH, mpgC, fueltypeId
FROM vehicle
JOIN vehicleMake ON vehicle.make = vehicleMake.make
JOIN vehicleModel ON vehicle.model = vehicleModel.model
JOIN vehicleDrive ON vehicle.drive = vehicleDrive.drive
JOIN vehicleFuelType ON vehicle.fueltype = vehicleFuelType.fueltype);

当我的表有“makeId”时...

CREATE TABLE ‘vehicleNormal’ (
‘vehicleId’ INT NOT NULL AUTO_INCREMENT,
‘fuelType’ VARCHAR (255) DEFAULT NULL,
‘makeId’ INT (11) DEFAULT NULL,
‘modelId’ INT (11) DEFAULT NULL,
‘year’ INT (11) DEFAULT NULL,
‘cylinders’ INT (11) DEFAULT NULL,
‘driveId’ INT (11) DEFAULT NULL,
‘mpgHighway’ DECIMAL(10,2),
PRIMARY KEY (‘vehicleId’)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;

任何帮助都会很棒。 :/

最佳答案

刚刚添加了车辆。到 SELECT 中的所有列。感谢戈登·利诺夫为我指明了正确的方向。

INSERT INTO vehicleNormal (makeId, modelId, year, cylinders, driveId, mpgHighway, mpgCity, fueltypeId)
(SELECT vehicle.make, vehicle.model, vehicle.year, vehicle.cylinders, vehicle.drive, vehicle.mpgHighway, vehicle.mpgCity, vehicle.fueltype
FROM vehicle
JOIN vehicleMake ON vehicle.make = vehicleMake.make
JOIN vehicleModel ON vehicle.model = vehicleModel.model
JOIN vehicleDrive ON vehicle.drive = vehicleDrive.drive
JOIN vehicleFuelType ON vehicle.fueltype = vehicleFuelType.fueltype);

关于mysql - 错误: Unknown column 'makeId' in 'field list' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26769902/

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