Re: increment row number function question

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: increment row number function question
Date: 2006-10-08 00:18:25
Message-ID: 452843D1.1030507@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/07/06 18:47, Matthew Peter wrote:
>> Thanks for the reply. Even if such a function existed, it would
>> almost certainly not do what you want in this query. Per SQL
>> spec, the SELECT target list is logically supposed to be
>> evaluated before the ORDER BY and LIMIT steps, which means you'd
>> get numbers associated with the physical ordering of the rows not
>> their some_col ordering.
>
> Shucks. I wanted to return a set with an ordered iterator
> determined by the ORDER BY. Could that be done? regards, tom lane

A stored procedure should do the trick, no?

- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFKEPRS9HxQb37XmcRAiRrAJ4vVxbhzwwH/8vWoZHH76lI4dT9kACg5zvH
ufGPSbGV0wHCvmkCPWjiI1U=
=PUKR
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Vanasco 2006-10-08 00:40:26 Re: performace review
Previous Message Matthew Peter 2006-10-07 23:47:00 Re: increment row number function question