pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@peufeu.com>
To: Ben K. <bkim@coe.tamu.edu>
To: pgsql-sql@postgresql.org
Subject: Re: Most efficient way to hard-sort records
Date: Mon, 08 May 2006 00:58:15 +0200
Message-ID: <op.s87d3dxscigqcu@apollo13> (raw)
In-Reply-To: <Pine.GSO.4.64.0605070837330.12629@coe.tamu.edu>
References: <445C5A94.4020907@startnet.cz>
	<Pine.GSO.4.64.0605061507500.7602@coe.tamu.edu>
	<op.s8590fficigqcu@apollo13>
	<Pine.GSO.4.64.0605070837330.12629@coe.tamu.edu>


> 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...



view thread (8+ messages)  latest in thread

Message-ID: <op.s87d3dxscigqcu@apollo13>
Permalink:  ../op.s87d3dxscigqcu@apollo13/
Also on:    postgresql.org/message-id/op.s87d3dxscigqcu@apollo13

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lists@peufeu.com, bkim@coe.tamu.edu
  Subject: Re: Most efficient way to hard-sort records
  In-Reply-To: <op.s87d3dxscigqcu@apollo13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox