I have an e-commerce shop and once a week the warehouse puts in another table only products that have changed their price. How to update the prices in the first table with the new prices of the selected products in the other table? Feel free to use also some php if it's not possible to do with mysql only.
I tried this command but when the SELECT founds no matches it changes my original prices to 0 instead of leaving them untouched.
UPDATE product_catalogue pc
SET pc.price = (SELECT new_price
FROM product_catalogue_updated pcu
WHERE pc.product_id = pcu.product_id)