1
我需要選擇的product_id的成本值,然後更新的product_idMySQL的多個SELECT語句與更新
的最低值,我不需要合併這兩個SELECT語句,然後運行更新。 我需要從一個領域獲得成本,然後再通過多個公式來設置我可以出售的最低價格。
##COST
SELECT value AS cost from catalog_product_entity_decimal
where attribute_id = 79 and
entity_id IN (select product_id from catalog_category_product)
##LOWEST
SELECT value AS lowest from catalog_product_entity_decimal
where attribute_id = 164 and
entity_id IN (select product_id from catalog_category_product)
update catalog_product_entity_decimal
set value = (cost+3.5)/.84
where attribute_id = 164 and
entity_id IN (select product_id from catalog_category_product);
我該如何去做這件事?我是一個MySQL新手,至少可以說。
我試過一個聯盟和多個選擇,但我想我做錯了。
最低屬性ID是164這是一個我想更新,而不是成本。我需要得到的成本,然後做數學更新最低 – Brad
@Brad呃,使用一個建議的方法和編輯它們... – feeela
除非我錯了,我不認爲你的方法將工作。我需要選擇product_id的成本值,然後更新該product_id的最低值。 – Brad