我正在尝试运行查询,但出现上述错误。 谁能告诉我为什么我得到它。
UPDATE `catalog_eav_attribute`
SET `used_for_sort_by` = 1
WHERE attribute_id = (
SELECT * FROM `eav_attribute` WHERE `entity_type_id` = (SELECT `entity_type_id` FROM `eav_entity_type` WHERE `entity_model` = "catalog/product") AND `attribute_code` = "created_at");
你有attribute_id = (select * . . .
. 据推测,eav_attribute
有多个列。
您需要指定特定列,如下所示:
UPDATE `catalog_eav_attribute`
SET `used_for_sort_by` = 1
WHERE attribute_id = (SELECT ea.attribute_id -- this is a guess
FROM `eav_attribute` ea
WHERE `entity_type_id` = (SELECT `entity_type_id`
FROM `eav_entity_type`
WHERE `entity_model` = 'catalog/product'
) AND
`attribute_code` = 'created_at'
);