Cudos Cudos - 1 year ago 69
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download