Re: Most efficient way to hard-sort records

From: PFC <lists(at)peufeu(dot)com>
To: "Ben K(dot)" <bkim(at)coe(dot)tamu(dot)edu>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Most efficient way to hard-sort records
Date: 2006-05-07 22:58:15
Message-ID: op.s87d3dxscigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


> Another version along that line ?
>
> # create sequence counterseq start 1;
> -- (set/reset whenever a counter is needed)
>
> # select main_table.*, nextval('counterseq') as position2
> into sorted_main_table
> from main_table, keytable where main_table.id =
> keytable.main_table_id
> order by value;

You could also use generate_series(), but I don't know if it can generate
unbounded series...

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2006-05-07 23:33:43 Re: Creating nested functions with plpgsql
Previous Message Ben K. 2006-05-07 14:16:41 Re: Most efficient way to hard-sort records