I need to select the cost value of a product_id and then update the lowest value of that product_id
I need no merge these two select statements, then run an update. I need to get the cost from one field and then multiple the formula to set the lowest price I can sell for.
##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);
How would I go about doing this? I'm a MySQL novice to say the least.
I've tried a UNION and Multiple Selects, but I guess I've done it wrong.