Is it possible to update values stored in a row by a certain increment without first querying the values and then adding it to the variable?
For example:
Lets say I have a table with fruits with 3 columns
table: fruits
column1 ID, column2 Apples, column3 Oranges, column4 Kiwi
1 3 2 4
If i want to update the values of apples, oranges, and kiwi by 2 how would i write a sql statement to reflect that?
"UPDATE fruits SET Apples='+2', Oranges='+2', Kiwi='+2' WHERE ID >=1"
i'm not really sure the syntax for this kind of operation or whether its even valid. Any ideas?
What I'd really like is to update the value with a variable. SOmething like this:
"UPDATE fruits SET Apples='+$x', Oranges='+$x', Kiwi='+$x' WHERE ID >=1"








Bookmarks