Re: select a ranking - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: select a ranking
Date
Msg-id 20020719133139.GA3951@wolff.to
Whole thread Raw
In response to Re: select a ranking  (Janning Vygen <vygen@gmx.de>)
List pgsql-general
On Fri, Jul 19, 2002 at 11:54:48 +0200,
  Janning Vygen <vygen@gmx.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.



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Can't link to libpq
Next
From: Thomas Lockhart
Date:
Subject: Re: problem set TIMEZONE