I've got two database tables: product and original_prices. Both tables have a field product_id (key) and price. I want to add a certain percentage to all prices from table original prices, let's say 50%), and store (update) these prices within table product.
I've got this, but it fails at the percentage calculation.
UPDATE product, original_prices SET product.price *= (1 + original_prices.original_price * 50 /100) WHERE product.product_id=original_prices.product_id
It gives me the 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 '*= (1 + original_prices.original_price * 50 /100) WHERE product.product_id' at line 1
I hope someone can help me out with this.