Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle? - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Date
Msg-id 20050517170616.GA20919@wolff.to
Whole thread Raw
In response to Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?  (<Dennis.Jiang@thomson.com>)
List pgsql-sql
On Thu, May 12, 2005 at 13:07:00 -0600, Dennis.Jiang@thomson.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.


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Next
From: Alain
Date:
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as