Search Postgresql Archives

Enumerating a row set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux