+ 3
Update a row in SQL
i wanna know how to decrease a column value while satisfiying a condition
3 Answers
+ 6
UPDATE table_name
SET column1 = value1, column2 = value2...., columnN = valueN
WHERE [condition];
https://www.tutorialspoint.com/sql/sql-update-query.htm
Update is done with update command
satisfying a condition is done with where command
Decrease a value, substract 1
UPDATE Orders SET Quantity = Quantity - 1 WHERE ...
Try the commands and see what happens.
+ 2
okay thanks
0
update tablename set columnname=existingvalue-value to be reduced [ where condition];