I need to increase price by 15% in some rows of a table named my_products
, based on the refresh_time of the product itself.
I don't know how to write this query, I was trying:
UPDATE my_products SET price = (price + 15%) WHERE refresh_time like "%2013%"
But this doesn't work.
UPDATE my_products SET price = (price * 1.15) WHERE refresh_time like "%2013%"
Just multiply the amount times 1.15. The 1
keeps the original value and the .15
adds the additional 15%.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With