Thread: How to... in update

How to... in update

From
"Marc Soler"
Date:
Hi all,

It's possible in postgres to increment a row in a UPDATE command.

something like this:  UPDATE table set col_name = 'foo', col_name2 ++ WHERE
condition

Thanks.
--
Marc Soler



Re: How to... in update

From
"A.Bhuvaneswaran"
Date:
> It's possible in postgres to increment a row in a UPDATE command.
>
> something like this:  UPDATE table set col_name = 'foo', col_name2 ++ WHERE
> condition

UPDATE table set col_name = 'foo', col_name2 = col_name2 + 1 WHERE
condition

Is the above your requirement? If yes, this is how it can be done.

regards,
bhuvaneswaran