Re: select a ranking

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: select a ranking
Дата
Msg-id 20020719133139.GA3951@wolff.to
обсуждение исходный текст
Ответ на Re: select a ranking  (Janning Vygen <vygen@gmx.de>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Can't link to libpq
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: problem set TIMEZONE