Re: getting the ranks of items

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: jd(at)commandprompt(dot)com (Joshua D(dot) Drake)
Cc: merlyn(at)stonehenge(dot)com (Randal L(dot) Schwartz), matt(at)jobsforge(dot)com (Matthew Terenzio), pgsql-general(at)postgresql(dot)org
Subject: Re: getting the ranks of items
Date: 2005-05-04 02:12:16
Message-ID: 200505040212.j442CHOn029724@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > 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? :)
>
> You could use a plPerl function.

To do it with ties, you'd need some way of passing the function the ranking
criteria with persistence between calls, which might have some startup issues.

Wouldn't that also cause problems with multiple users calling the function
simultaneously?
--
Mike Nolan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-05-04 03:22:54 Re: Favorable Postgresql write up
Previous Message Joshua D. Drake 2005-05-04 01:55:11 Re: getting the ranks of items