Re: getting the ranks of items

From: merlyn(at)stonehenge(dot)com (Randal L(dot) Schwartz)
To: Matthew Terenzio <matt(at)jobsforge(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: getting the ranks of items
Date: 2005-05-04 00:57:35
Message-ID: 86mzrbu7sw.fsf@blue.stonehenge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "Matthew" == Matthew Terenzio <matt(at)jobsforge(dot)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(at)stonehenge(dot)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!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lyubomir Petrov 2005-05-04 01:13:59 Re: getting the ranks of items
Previous Message Matthew Terenzio 2005-05-04 00:55:03 Re: getting the ranks of items