gpt4 book ai didi

mysql - 错误 1054 - 'column' mysql 中的未知列 'where clause'

转载 作者:行者123 更新时间:2023-11-30 23:08:16 25 4
gpt4 key购买 nike

我在 MySQL 中遇到问题。这是我的代码:

UPDATE ad_copy, (
SELECT CONCAT_WS(" - ", ad_copy.title, stitle.ttitle) AS `p`
from ad_copy, stitle
where ad_copy.category = stitle.subcat
ORDER BY RAND()) `p`
set `title` = `p`
where ad_copy.category = stitle.subcat

我不明白这是什么问题。预先感谢您的帮助

最佳答案

尝试使用 join 更新,您的自定义列通过子查询 (SELECT CONCAT_WS ..) as p 无法识别

UPDATE 
ad_copy a
JOIN stitle s ON (a.category = s.subcat)
SET a.`title` = CONCAT_WS( " - ",a.title,s.ttitle)

编辑

UPDATE 
ad_copy a
JOIN stitle s ON (a.category = s.subcat)
SET a.`title` = CONCAT_WS( " - ",a.title, (SELECT ttitle FROM stitle WHERE subcat =a.category ORDER BY RAND() LIMIT 1 ))

关于mysql - 错误 1054 - 'column' mysql 中的未知列 'where clause',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20910729/

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