Is there a way to update rows based on current value. So instead of querying current value, you can say quantity + 10 for an update? I know Postgres supports it natively, does the API have a way of doing it?
m
magicbyt3
02/14/2022, 4:30 PM
yes I think something like this should work:
Copy code
sql
UPDATE yourtable SET yourvalue = CASE
WHEN yourvalue = 5 THEN yourvalue + 5
WHEN yourvalue = 10 THEN yourvalue + 10
END