Reputation: 501
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.
Upvotes: 4
Views: 20535
Reputation: 219924
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%.
Upvotes: 14