| Re: position in ordered results -
06-04-2007, 07:58 AM
On 24 May, 17:26, strawberry <zac.ca...@gmail.com> wrote:
> On May 24, 5:22 pm, Iain Adams <aca04...@shef.ac.uk> wrote:
>
> > Hi,
>
> > I have a table with some ranks in. Firstly I want to order the table
> > by the ranks. Then I want to search the new ordered table to find out
> > the position of a specific row with a specific rank. Is this possible??
>
> but won't that just be equal to the rank:
>
> id rank
> 1 4
> 2 5
> 3 3
> 4 1
> 5 2
>
> SELECT * FROM table ORDER BY rank
>
> 4 1
> 5 2
> 3 3
> 1 4
> 2 5
>
>
Not quite because the ranking refers to a world ranking scale. Thus
the ranks actually are values from around 1000 to 3000, these aren't
ranks exactly but are a kind of score that person has. So I need to
find, the rank of that person out of all the people in the table. |