Re: question re incrementing an integer field in a table.

Поиск
Список
Период
Сортировка
От Aleksej Trofimov
Тема Re: question re incrementing an integer field in a table.
Дата
Msg-id 4EEB2AE2.5000508@ruptela.lt
обсуждение исходный текст
Ответ на question re incrementing an integer field in a table.  (richard terry <rterry@internode.on.net>)
Список pgsql-novice
On 12/16/2011 12:57 PM, richard terry wrote:
> Hope this question isn't too idiotic and makes sense.
>
>
> Is there a simple way to increment the value of an integer field in a table in
> sql  without reading the fields value  adding 1 and re-saving? (the field is not
> a primary key or any other sort of foreign key)
>
> regards
>
> richard
>
>
Try this

UPDATE tables SET inc=inc+1 WHERE key=ID;


--
Best regards

Aleksej Trofimov



В списке pgsql-novice по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: question re incrementing an integer field in a table.
Следующее
От: Marcus Engene
Дата:
Сообщение: External ordered set of id:s, want to preserve order