Re: getting the ranks of items - Mailing list pgsql-general

From merlyn@stonehenge.com (Randal L. Schwartz)
Subject Re: getting the ranks of items
Date
Msg-id 86mzrbu7sw.fsf@blue.stonehenge.com
Whole thread Raw
In response to Re: getting the ranks of items  (Matthew Terenzio <matt@jobsforge.com>)
Responses Re: getting the ranks of items
List pgsql-general
>>>>> "Matthew" == Matthew Terenzio <matt@jobsforge.com> writes:

Matthew> On May 3, 2005, at 8:30 PM, Randal L. Schwartz wrote:

>> Is there a simple way with PostgreSQL to assign relative ranks to the
>> result of a query ORDER BY?


Matthew> What do you mean by ranks?

If I order a query by ascending age, the youngest person gets
rank 1, the second youngest gets rank 2, the third youngest gets rank 3,
and if the fourth and fifth tie, they both get 4, and the next one gets 6.

You know, rank? :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

pgsql-general by date:

Previous
From: Matthew Terenzio
Date:
Subject: Re: getting the ranks of items
Next
From: Lyubomir Petrov
Date:
Subject: Re: getting the ranks of items