Re: Numbering rows - Mailing list pgsql-general

From Mark Morgan Lloyd
Subject Re: Numbering rows
Date
Msg-id gd5j62$7cv$1@pye-srv-01.telemetry.co.uk
Whole thread Raw
In response to Numbering rows  (Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk>)
List pgsql-general
Thanks everybody- I'm watching with a lot of interest. I was worried
that I was asking something stupid with an obvious answer...

ries van Twisk wrote:
> May be this function can help :
>
> http://www.postgresql.org/docs/8.3/static/functions-srf.html

Thanks, that's already turning out to be useful for something else I was
working on today:

select percent,
to_char(nedcar_tonnes_001(percent), '99990.99') AS nedcar
from generate_series(0,110,10) as percent;

The one thing I'd say about generate_series() is that the description
suggests that one has to put an explicit count() as the second parameter
if using it to number rows, i.e. it doesn't have an "as many as
necessary" option.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: No select permission on a table but can query it
Next
From: "D. Dante Lorenso"
Date:
Subject: Re: Numbering rows