gpt4 book ai didi

mysql - 交叉表 JOIN 错误

转载 作者:行者123 更新时间:2023-11-29 00:46:30 25 4
gpt4 key购买 nike

很遗憾,我不知道问题出在哪里?

UPDATE catalog_product_entity_varchar SET value = '{somevalue}'

FROM cataloginventory_stock_item AS csi
JOIN catalog_product_entity AS cpe ON cpe.entity_id = csi.product_id
JOIN catalog_product_entity_varchar AS cpev ON cpev.entity_id = cpe.entity_id

WHERE attribute_id = '1691' AND sku = '605284470695';

错误

Error Code: 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 'FROM cataloginventory_stock_item AS csi      JOIN catalog_pr' at line 3

最佳答案

SET 子句应该在表引用之后:

UPDATE
cataloginventory_stock_item AS csi
JOIN catalog_product_entity AS cpe ON cpe.entity_id = csi.product_id
JOIN catalog_product_entity_varchar AS cpev ON cpev.entity_id = cpe.entity_id
SET cpev.value = '{somevalue}'
WHERE attribute_id = '1691' AND sku = '605284470695';

关于mysql - 交叉表 JOIN 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10356617/

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