Search Postgresql Archives

sort by update

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

 



The following code works to update a table in order with a sequence.
I have tried it on a number of different types of fields.

create temporary sequence seq_1;

update tbl1 set currentsort=nextval('seq_1')
from (select tbl1id from tbl1 order by tbl1id) b
where tbl1.tbl1id=b.tbl1id;

drop sequence seq_1;

My question is, will it always work? In other words is it programmed
that way or is this an unintended feature that might stop working sometime.

Thanks
Sim

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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