Re: Numbering rows

From: "David Rowley" <dgrowley(at)gmail(dot)com>
To: "'A(dot) Kretschmer'" <andreas(dot)kretschmer(at)schollglas(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Numbering rows
Date: 2008-10-16 06:56:47
Message-ID: 4EF01D4FCE524CA7BD910086553D2CD0@amd64
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomasz Ostrowski 2008-10-16 07:34:44 Re: Drupal and PostgreSQL - performance issues?
Previous Message Murray Fox 2008-10-16 06:55:06 Re: Problems with Timezones in Australia