gpt4 book ai didi

mysql - #1064 语法错误 : In "Update Query"

转载 作者:行者123 更新时间:2023-12-01 00:48:24 26 4
gpt4 key购买 nike

当我使用这段mysql代码时

update catalog_product_entity_decimal
set value = "6.0000"
where attribute_id = 75 and
entity_in ( SELECT
product_id
from `catalog_category_product`
WHERE category_id =37 );

我遇到了这个错误

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT product_id from `catalog_category_product` ' at line 4

我无法弄清楚我的查询有什么问题。谁能告诉我哪里出了问题?

谢谢

最佳答案

您在 entity_in 之后缺少 IN 子句。使用这个:

update catalog_product_entity_decimal
set value = "6.0000"
where attribute_id = 75 and
entity_id IN ( SELECT
product_id
from `catalog_category_product`
WHERE category_id =37 );

关于mysql - #1064 语法错误 : In "Update Query",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18650567/

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