Re: How to update record in a specified order

From: "Dan Langille" <dan(at)langille(dot)org>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to update record in a specified order
Date: 2002-08-09 22:02:54
Message-ID: 3D5403CE.24005.28A4CC60@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Adam Erickson 2002-08-09 22:04:23 Re: retrieving all rows from a "tree" in one select - how ?
Previous Message Jean-Luc Lachance 2002-08-09 21:59:49 Re: How to update record in a specified order