UPDATE WITH ORDER BY - Mailing list pgsql-sql

From Rodrigo Carvalhaes
Subject UPDATE WITH ORDER BY
Date
Msg-id 426DB1A0.2000604@carvalhaes.net
Whole thread Raw
In response to Re: searching cidr/inet arrays  (Michael Fuhr <mike@fuhr.org>)
Responses Re: UPDATE WITH ORDER BY  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-sql
<div class="moz-text-html" lang="x-western"><tt>Hi Guys!<br /><br /> I need to make an UPDATE on a column reordering it
witha sequence using order by a description.<br /> Confusing??? Well.. Let me give an example...<br /><br /> Today, my
tableit's organized like this:<br /><br /> Code     / Description<br /> 9          Orange<br /> 15         Apple<br />
1         Pear<br /> 3          Tomato<br /><br /> I wanna to reorganize (reordering the code from 1 to ... ordering by
description)<br/></tt><tt><br /> Code     / Description<br /></tt><tt>1          Apple</tt><br /><tt>2         
Orange<br/> 3          Pear<br /> 4          Tomato</tt><br /><tt><br /> I created a sequence but I am having no succes
touse it because UPDATE don't accept ORDER BY CLAUSE. The "ideal SQL" is UPDATE table SET code = nextval('sequence')
ORDERBY description <br /><br /> I searched a lot on the NET without ant "tip" for my case. <br /> It's a very simple
needbut I am not able to solve it...<br /><br /> Anyone knows how I can do it?<br /><br /> Cheers,<br /><br /> -- <br
/>Rodrigo Carvalhaes<br /><br /></tt></div><br />-- <br />Esta mensagem foi verificada pelo sistema de antivírus e <br
/>acredita-se estar livre de perigo.  

pgsql-sql by date:

Previous
From: "Dan Langille"
Date:
Subject: people who buy A, also buy C, D, E
Next
From: Christoph Haller
Date:
Subject: Re: UPDATE WITH ORDER BY