From: Dan Langille <dan@langille.org>
To: Jean-Luc Lachance <jllachan@nsd.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to update record in a specified order
Date: Fri, 09 Aug 2002 18:02:54 -0400
Message-ID: <3D5403CE.24005.28A4CC60@localhost> (raw)
In-Reply-To: <200208091437.52702.josh@agliodbs.com>
References: <3D54326E.EB235934@nsd.ca>
On 9 Aug 2002 at 14:37, Josh Berkus wrote:
> JLL,
>
> > I want to update a field with a 'NEXTVAL', but I want the record updated
> > in a specific order.
> > Any simple way of doing this other than having to create a temp table?
>
> Please be more speciifc. What do you mean, "specified order"?
My reading of what is required:
- sort a given result set according to some criteria
- then do something like UPDATE table SET myfield = NEXTVAL
- each row in the result set would get a value one more than the
previous row
--
Dan Langille
I'm looking for a computer job:
http://www.freebsddiary.org/dan_langille.php
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: dan@langille.org, jllachan@nsd.ca
Subject: Re: How to update record in a specified order
In-Reply-To: <3D5403CE.24005.28A4CC60@localhost>
* 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