Search Postgresql Archives

Re: Help pls with UPDATE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



go KEY802207 wrote:
> Hi, pgsql-general.
> 
>   Tell me please, how to update a set of rows using order-
>   something like :
> 
>   update my_table set counter1=nextval('my_seq') order by counter2 ;

The way this is usually done is to issue a SELECT with an ORDER BY
clause, then update the rows that are returned.  Many DBMSs have a
SELECT FOR UPDATE and then UPDATE WHERE CURRENT OF CURSOR, but a quick
read of the documentation doesn't list such constructs for PostgreSQL,
so if not you'll need to use separate statements.

-- 
Guy Rouillier


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux