I've got two database tables, namely: original_prices and product.
Both tables have a field named product_id (key), and a field named price.
Now I want to retrieve all prices in table original_prices (field price), add $5.00 to those prices and store them into table product (field price).
I tried a couple of things myself, but I can't figure out how to do this.
Currently my coding is:
Update product set product.price=original_prices.original_price+5 from product inner join original_prices on product.product_id=original_prices.product_id
But that gives me the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from product inner join original_prices on product.product_id=original_prices.pr' at line 1
Hopefully someone can tell me what I'm doing wrong here.