in reply to Re: Re: What's an Efficient Way to Retrieve a Rank from a MySQL Table?
in thread What's an Efficient Way to Retrieve a Rank from a MySQL Table?

It actually depends whether you want to rank a) the students or b) their scores:
a) student d ist 4th
b) student d has 2nd best score

pelagic
  • Comment on Re^3: What's an Efficient Way to Retrieve a Rank from a MySQL Table?

Replies are listed 'Best First'.
Re: Re^3: What's an Efficient Way to Retrieve a Rank from a MySQL Table?
by soon_j (Scribe) on May 04, 2004 at 12:14 UTC

    You have a point. It's safe to say that student "d" has the 2nd best score and the 4th from the list. However, let's say that student "d" and another student "f" has the same score, we still safely say that student "d" has the 2nd best score (together with "f"), but is student "d" right now still the 4th or would he be the 5th? We can't directly tell, except if we add another criteria that makes student "d" be listed as 5th and student "f" as 4th.

    Thanks.

      These scores:
      student - score a - 70 b - 70 c - 70 d - 60 f - 60 e - 50
      simply must lead to following ranking:
      Students Rank: 1. a,b,c 4. d,f 6. e
      Ranking the score-values is of little practical use.
      As Abigail mentionned above: 50 is the 3rd Score (if you rank scores without considering their actual occurrence).
      But student e with score 50 was last of 6.

      pelagic