0

I have nearly 2000 items, I would like to copy 'price' attribute value to 'newPrice' attribute value for all the items, within table catalog_product_entity_decimal (I think this is the right table)

eg. attribute_id of price is 60, entity_id = 1 and value = 50

attribute_id   entity_id   value
60              1           50
60              2           56

newPrice - attribute_id = 75

Final Result:

attribute_id   entity_id      value
    60              1           50
    60              2           56
    75              1           50
    75              2           56

For the subsequent entity_id 1,2,3,4 and so on

SQL query from phpmyadmin? If this is the correct/safe way, what could be mysql query?

any other suggestion?

Thank you

0
INSERT INTO catalog_product_entity_decimal (entity_type_id, attribute_id, store_id, entity_id, value)
SELECT entity_type_id, 75, store_id, entity_id, value
FROM catalog_product_entity_decimal
WHERE attribute_id = 60;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.