Numbering rows - Mailing list pgsql-general

From Mark Morgan Lloyd
Subject Numbering rows
Date
Msg-id gd5dln$thq$1@pye-srv-01.telemetry.co.uk
Whole thread Raw
Responses Re: Numbering rows
Re: Numbering rows
List pgsql-general
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]

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: slony and fill factor
Next
From: ries van Twisk
Date:
Subject: Re: Numbering rows