How do I update a field using it at the same time?

1

I would like to know if you have a way to sum the value of a line with itself without having to query after an update.

I have a column called total that holds integers, at some point I want the value that is on this line to be summed with a new value entered, without having to do a query, add with a new value and then do the update.

    
asked by anonymous 21.09.2016 / 05:05

1 answer

3

I think this is what you need:

update tabela set total = total+5
    
21.09.2016 / 05:25