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

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: question re incrementing an integer field in a table.
Date: 2011-12-16 11:24:56
Message-ID: jcf9oc$sph$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

richard terry, 16.12.2011 11:57:
> 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)
>

Not sure I understand you question, but are you maybe looking for:

update the_table
set the_column = the_column + 1;

Thomas

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Aleksej Trofimov 2011-12-16 11:26:26 Re: question re incrementing an integer field in a table.
Previous Message Thom Brown 2011-12-16 11:09:05 Re: question re incrementing an integer field in a table.