0

我想使用以下 sql 代码将所有具有相同描述的产品设置为具有指定类别 ID 的产品,但在同一类别下它不会更新具有相同描述的产品。

update catalog_product_entity_text
  set value = "the product's name test hah test."
  where attribute_id = 66 and
        entity_id (select product_id from catalog_category_product
                    where category_id = 40);

谢谢你。

4

2 回答 2

0

尝试像这样使用“entity_id IN ...”:

update catalog_product_entity_text
  set value = "the product's name test hah test."
  where attribute_id = 66 and
        entity_id IN (select product_id from catalog_category_product
                    where category_id = 40);
于 2013-01-09T17:31:08.140 回答
0

您忘记IN在 entity_id 和选择查询之间进行写入。

我不知道您使用的是哪个版本,但对我来说 short_description 的 attribute_id 是 65,而描述是 64。

于 2013-01-09T17:31:46.593 回答