Re: olympics ranking query

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: olympics ranking query
Date: 2004-08-20 17:01:48
Message-ID: 20040820170148.GB26674@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Aug 20, 2004 at 23:40:08 +0700,
David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Garamond 2004-08-20 17:11:36 Re: olympics ranking query
Previous Message Tom Lane 2004-08-20 16:46:22 Re: olympics ranking query