Professional Web Applications Themes

position in ordered results - MySQL

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??...

  1. #1

    Default position in ordered results

    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??

    Iain Guest

  2. #2

    Default Re: position in ordered results

    On May 24, 5:22 pm, Iain Adams <ac.uk> wrote: 

    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

    ?

    strawberry Guest

  3. #3

    Default Re: position in ordered results

    On 24 May, 17:26, strawberry <com> wrote: 

    >
    > 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
    >
    >[/ref]

    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.

    Iain Guest

  4. #4

    Default Re: position in ordered results

    Iain Adams <ac.uk> wrote:
     

    select count(*) from table where rank < (rank of specific person)

    --
    Pd
    PeterD Guest

Similar Threads

  1. Replies: 1
    Last Post: October 22nd, 08:44 PM
  2. Ordered list in cfoutput?
    By SquiSh1717 in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: July 10th, 12:06 PM
  3. query results accessed by column/ordinal position
    By jjs4775 in forum Macromedia ColdFusion
    Replies: 1
    Last Post: April 29th, 12:06 AM
  4. Make ordered list
    By EllenM in forum Dreamweaver AppDev
    Replies: 0
    Last Post: March 16th, 08:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139