Enumerating a row set

Поиск
Список
Период
Сортировка
От George Sakkis
Тема Enumerating a row set
Дата
Msg-id 91ad5bf80903261542l36ae10fcle98ba9d4688c277@mail.gmail.com
обсуждение исходный текст
Ответы Re: Enumerating a row set  (Steve Atkins <steve@blighty.com>)
Re: Enumerating a row set  (David Fetter <david@fetter.org>)
Список pgsql-general
Hi all,

Is there a function similiar to Python's enumerate() [1] ? Searching
the docs didn't reveal any relevant builtin but I hope it's doable in
pgsql. Ideally I'd like a function that can be used as:

SELECT e.i, e.col1, e.col2
FROM enumerate(some_table, 'i') e
LIMIT 10

i   col1  col2
=========
0   ...     ...
1   ...     ...
...   ...     ...
9   ...     ...

Also ideally it should work on any rowset (e.g. nested select), not
just on concrete tables.

Thanks in advance,
George

[1] http://docs.python.org/library/functions.html#enumerate

В списке pgsql-general по дате отправления:

Предыдущее
От: Dhaval Jaiswal
Дата:
Сообщение: Re: how to specify the locale that psql uses
Следующее
От: Dhaval Jaiswal
Дата:
Сообщение: Re: how to avoid that a postgres session eats up all the memory