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

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Дата
Msg-id 20050517170616.GA20919@wolff.to
обсуждение исходный текст
Ответ на Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?  (<Dennis.Jiang@thomson.com>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?
Следующее
От: Alain
Дата:
Сообщение: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as