Re: Numbering rows

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>
Cc: "ries van Twisk" <pg(at)rvt(dot)dds(dot)nl>, "Mark Morgan Lloyd" <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: Numbering rows
Date: 2008-10-15 19:32:57
Message-ID: dcc563d10810151232lb73c289gc83cc65978b6113b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 15, 2008 at 1:23 PM, Richard Broersma
<richard(dot)broersma(at)gmail(dot)com> wrote:
> On Wed, Oct 15, 2008 at 12:08 PM, ries van Twisk <pg(at)rvt(dot)dds(dot)nl> wrote:
>> May be this function can help :
>>
>> http://www.postgresql.org/docs/8.3/static/functions-srf.html
>
> Using generate series won't number the rows that way that you would
> want. You basically will end up with a cross join between the
> generated series and the requested set. There are three ways that I
> know of to get a row number:

Can't you put the query into a subselect with an offset 0 and join to
that to get the generate_series to work correctly?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michele Petrazzo - Unipex srl 2008-10-15 19:33:26 No select permission on a table but can query it
Previous Message Bruce Momjian 2008-10-15 19:28:59 Re: Drupal and PostgreSQL - performance issues?