Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 65766475E98 for ; Fri, 9 Aug 2002 18:02:35 -0400 (EDT) Received: from bast.unixathome.org (bast.unixathome.org [216.187.105.150]) by postgresql.org (Postfix) with ESMTP id C7DE6475E8C for ; Fri, 9 Aug 2002 18:02:34 -0400 (EDT) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id 18ECF3F28; Fri, 9 Aug 2002 18:02:36 -0400 (EDT) From: "Dan Langille" To: Jean-Luc Lachance Date: Fri, 09 Aug 2002 18:02:54 -0400 MIME-Version: 1.0 Subject: Re: How to update record in a specified order Cc: pgsql-sql@postgresql.org Message-ID: <3D5403CE.24005.28A4CC60@localhost> References: <3D54326E.EB235934@nsd.ca> In-reply-to: <200208091437.52702.josh@agliodbs.com> X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/171 X-Sequence-Number: 9017 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