Re: Numbering rows - Mailing list pgsql-general

From David Rowley
Subject Re: Numbering rows
Date
Msg-id 4EF01D4FCE524CA7BD910086553D2CD0@amd64
Whole thread Raw
In response to Re: Numbering rows  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: Numbering rows
List pgsql-general
Andreas Kretschmer wrote:
> Can you show an example for 8.4?

It's not 100% certain that it will be possible for 8.4, probably though.

select row_number() over (order by employeeid) as nrow,* from employee order
by employeeid

It's important to have both the order bys

There is more information on windowing functions here
http://en.wikipedia.org/wiki/SELECT

David.


pgsql-general by date:

Previous
From: Michele Petrazzo - Unipex srl
Date:
Subject: Re: No select permission on a table but can query it
Next
From: Murray Fox
Date:
Subject: Re: Problems with Timezones in Australia