Subtract variable in a BD - SQL

0

I have the following question about BD in sql, I have a value and I wanted to know if I can subtract it directly from the variable that is in the DB with a query or I will ask for that value, subtract it and then replace it in my DB.

    
asked by Gustavo 26.07.2017 в 17:49
source

1 answer

2

If possible, for example: UPDATE tabla SET campo1=campo1-campo2 WHERE id=2; o UPDATE tabla SET campo1=campo1-25 WHERE id=2;

    
answered by 26.07.2017 / 17:56
source