How to update the discount_price in DB I need to add value to existing value according to my condition Example: any product has the price from 10 to 30 I have to add 1.5 to it.
product with 15 should be 16.5 for example
I have written this query
UPDATE products
SET discount_price = discount_price + 1.5
WHERE discount_price >= 10 AND discount_price <= 30;
But I found this error >>
SQL error:
ERROR: syntax error at or near "SET" LINE 1: SELECT COUNT(*) AS total FROM (UPDATE products SET discount_... ^ In statement: SELECT COUNT(*) AS total FROM (UPDATE products SET discount_price = discount_price + 1.5 WHERE discount_price >= 10 AND discount_price <=30) AS sub