Re: select a ranking

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Janning Vygen <vygen(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select a ranking
Date: 2002-07-19 13:31:39
Message-ID: 20020719133139.GA3951@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 19, 2002 at 11:54:48 +0200,
Janning Vygen <vygen(at)gmx(dot)de> wrote:
>
> this wont work because the ranking is not equal to the rownumber.
> there are very often two second places. and there might be a
> complicated logic to the ordering. there might be many columns
> affected to to the ordering in sql.
>
> the presentation tool can just number the rows, but it cant decide
> easily if there are two second places. in sport rankings you have
> often more than five ordering parameters and you still can have two
> second places. So the presentation tool needs to know this ordering
> logic to decide how to do the ranking. if there are changes in
> ranking/ordering logic, i need to update all my presentation
> clients...

I have a site where people are ranked in how well they play various
boardgames. Their ranking is one more than the number of people
who have higher ratings than them. While you could generate this
number using a subselect, it wouldn't be very efficient. It is
very easy to do in the presentation script using a counter, a saved rating
and a saved count.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-19 13:42:32 Re: Problem using ?# with polygon
Previous Message Tom Lane 2002-07-19 13:31:05 Re: [SQL] id and ID in CREATE TABLE