Обсуждение: How to... in update

Поиск
Список
Период
Сортировка

How to... in update

От
"Marc Soler"
Дата:
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

От
"A.Bhuvaneswaran"
Дата:
> 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