Getting the ranks of results from a query - Mailing list pgsql-sql

From abhi
Subject Getting the ranks of results from a query
Date
Msg-id 74D2329E-83F6-11D8-A142-000A95DA7BB2@mit.edu
Whole thread Raw
Responses Re: Getting the ranks of results from a query  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
I have a query of the form
select id from member order by age;

id
----- 431  93 202 467 300

In addition to the id, I would like the get the rank of the row--
in other words:
 id  | rank
-----+----------- 431 | 1  93 | 2 202 | 3 467 | 4 300 | 5


How do I do this with postgres?  In the past, I have used something like

select id, identity(int, 1,1) from member order by age;


is there a postgres equivalent?


Thanks



pgsql-sql by date:

Previous
From: "malia, sean"
Date:
Subject: Re: DB question - Merging data from one table to another.
Next
From: Josh Berkus
Date:
Subject: Re: Function To Log Changes