How to update a field using it at the same time?

Asked

Viewed 51 times

1

I wonder if there’s a way to add the value of a line to itself without having to do a query then an update.

I have a column called total that stores integers, at a given time I want the value that is on this line to be summed with a new value inserted, without it being necessary to do a query, add with a new value and then do the update.

1 answer

3


I think that’s what you need:

update tabela set total = total+5
  • And I complicating rs. Thank you very much!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.