gpt4 book ai didi

Mysql更新查询错误: Unknown Column in 'field list'

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

我尝试使用以下查询添加新列:

UPDATE t1
INNER JOIN
(SELECT
t1.CID as t1_id,
t2.id as t2_id
FROM t3
INNER JOIN t1 ON t3.CID = t1.CID
INNER JOIN t4 ON t4.MID = t3.MID
INNER JOIN t2 ON t2.serial = t4.Serial
AND t3.Time BETWEEN t2.Start_Time AND t2.End_Time) as sub
ON sub.t1_id = t1.CID
SET t1.t2_id = sub.t2_id

显示错误:“字段列表”中存在未知列“t1.t2_ID”

我见过几个 fieldlist 错误解决方案,但没有一个真正对我有帮助。因此,任何帮助将不胜感激。

最佳答案

如果您想添加列,请使用ALTER TABLE

ALTER TABLE table
ADD [COLUMN] column_name column_definition [FIRST|AFTER existing_column];

http://www.mysqltutorial.org/mysql-add-column/

然后您可以使用UPDATE来填充该字段

关于Mysql更新查询错误: Unknown Column in 'field list' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53434091/

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