May be this function can help :
http://www.postgresql.org/docs/8.3/static/functions-srf.html
Ries
On Oct 15, 2008, at 1:44 PM, Mark Morgan Lloyd wrote:
Is there an easy way to assign a sequential number, possibly based
on an arbitrary minimum (typically 0 or 1) to each row of an ordered
result set, or do I have to work with explicit sequences?
I need to do quite a lot of maths on successive rows, extracting
numeric and timestamp differences hence rates of change. I've
typically been doing it manually or in a spreadsheet but there has
to be a better way e.g. by a join on offset row numbers.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or
colleagues]
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general