Thread: sort by update

sort by update

From
Sim Zacks
Date:
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