Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Dennis(dot)Jiang(at)thomson(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Date: 2005-05-17 17:06:16
Message-ID: 20050517170616.GA20919@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php pgsql-sql

On Thu, May 12, 2005 at 13:07:00 -0600,
Dennis(dot)Jiang(at)thomson(dot)com wrote:
> Hi:
>
> Oracle has a pseudo-column "ROWNUM" to return the sequence number in which a row was returned when selected from a table. The first row ROWNUM is 1, the second is 2, and so on.
>
> Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle? If so, we can write the following query:

No.

>
> select *
> from (select RowNum, pg_catalog.pg_proc.*
> from pg_catalog.pg_proc) inline_view
> where RowNum between 100 and 200;

You could use LIMIT and OFFSET to get the values from the table for the
100th through 200th rows (though typically you want to add an ORDER BY
clause). You could have you application supply the rownum column values.

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Andrew Sullivan 2005-05-17 17:06:36 Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Previous Message Scott Marlowe 2005-05-17 17:01:03 Re: Does Postgresql have a similar pseudo-column "ROWNUM" as

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2005-05-17 17:06:36 Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Previous Message Scott Marlowe 2005-05-17 17:01:03 Re: Does Postgresql have a similar pseudo-column "ROWNUM" as