On Thu, Mar 26, 2009 at 8:55 PM, David Fetter wrote:
> In PostgreSQL 8.4, you'll be able to do:
>
> SELECT
> row_number() OVER (ORDER BY col1) AS i,
> e.col1,
> e.col2,
> ...
> FROM ...
Good news! Better late than never :)
> Until then, there are some ugly, fragile workarounds with
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Guy Rouillier
Sent: Friday, March 27, 2009 2:54 AM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Enumerating a row set
On Thu, Mar 26, 2009 at 06:42:45PM -0400, George
On Thu, Mar 26, 2009 at 06:42:45PM -0400, George Sakkis wrote:
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.
I found this via Google:
http://www.depesz.com/index.php/2007/08/17/rownum-
On Thu, Mar 26, 2009 at 06:42:45PM -0400, George Sakkis wrote:
> 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.col
On Mar 26, 2009, at 3:42 PM, George Sakkis wrote:
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 enumerat
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