Can I add data to existing data of a table and persist it without firing a query to fetch the current data?
For example: I have a Stock table, in which I have two columns itemame(varchar2) and stock(integer). Suppose initially I have item1 with stock 10.
Now can I add 5 to this present 10 directly through a query, without fetching the current stock?
The SQL UPDATE command can refer to existing row values for addition and subtraction. This is handy, as the update is atomic and thus thread and transaction safe.
You’ll probably want something like: