Re: olympics ranking query

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: olympics ranking query
Дата
Msg-id 20040820170148.GB26674@wolff.to
обсуждение исходный текст
Ответ на olympics ranking query  (David Garamond <lists@zara.6.isreserved.com>)
Ответы Re: olympics ranking query  (David Garamond <lists@zara.6.isreserved.com>)
Список pgsql-sql
On Fri, Aug 20, 2004 at 23:40:08 +0700, David Garamond <lists@zara.6.isreserved.com> wrote:
> 
> Challenge question: is there a simpler way to do query #1 (without any 
> PL, and if possible without sequences too?

You could use a subselect to count how many countries had a lower
medal ranking and add 1 to get the rank. This should be a lot more standard
than using sequences. It will probably be a little slower, but for tables
of that size it shouldn't be a big deal.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: olympics ranking query
Следующее
От: David Garamond
Дата:
Сообщение: Re: olympics ranking query