Re: Numbering rows - Mailing list pgsql-general

From ries van Twisk
Subject Re: Numbering rows
Date
Msg-id 16170243-B840-4478-BA05-99221EA67915@rvt.dds.nl
Whole thread Raw
In response to Numbering rows  (Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk>)
Responses Re: Numbering rows
List pgsql-general
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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general








pgsql-general by date:

Previous
From: Mark Morgan Lloyd
Date:
Subject: Numbering rows
Next
From: "Richard Broersma"
Date:
Subject: Re: Numbering rows