Cudos Cudos - 6 months ago 30
MySQL Question

Mysql merge field from table to another

I want to merge the field "price" from the table "products" into the field "price" in the table "products_description". Both tables has "products_id" that match.

Can't really get my head around it.


Something like:-

UPDATE products_description pd
INNER JOIN products p 
ON p.productid = pd.productid
    pd.price = p.price;

That will copy the price from table products into products_description! Although it may not be 100% apparent this is what you want.