Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Ranking of results?

    I've got various statistics, some are calculated from a query, which I'm
    putting into a custom query which I'm running a query of a query on. This
    works fine, but the next thing I'd like to do is to take the same data and
    determine the ranking of the various statistics compared to the rest of the
    data set.

    So for using baseball for an example, let's say I have

    Stats
    Player | At Bats | Hits | Batting Avg
    Bob | 400 | 100 | .250
    Jack | 200 | 75 | .375
    Ted | 300 | 125 | .416

    Now I'd like to take this data and determine where players would rank in the
    individual categories.

    Rank
    Player | At Bats | Hits | Batting Avg
    Bob | 1 | 2 | 3
    Jack | 3 | 3 | 2
    Ted | 2 | 1 | 1

    Any ideas on the best way to accomplish this? I'm drawing a blank here.

    Dave


    Dave Guest

  2. Similar Questions and Discussions

    1. ranking in mysql query
      Hi all, just wondering if its possible to do a ranking with an update query ? all suggestions are appreciated
    2. ASP/SQL Ranking Query
      Tim J wrote: With Access, I can't think of any way to do this that does not involve a custom function called from the query. Unfortunately, you...
    3. Ranking count values?
      What database is this? If it's SQL Server, you should be able to say TOP 10 WITH TIES ... "Willem-Jan Selen" <wselen@hotmail.com> wrote in...
    4. sorting and ranking
      "shallabaz" <shallabaz@yahoo.com> wrote in message news:0c1f01c3454f$3abb6b40$a501280a@phx.gbl... Assuming you have properly normalized tables it...
    5. Combo box and ranking
      X records on a continuous form which I want to number 1 to X. Any ideas about how I can use a combo to do this e.g. if there are five records to...
  3. #2

    Default Re: Ranking of results?

    This would increase the processing, but off the top of my head.

    If you did a QoQ of the QoQ and do an order by the column this would give you
    the ranking order for that column, you could then loop through the result set
    and insert the ranking into the column.

    But you would need to do this for every column you wanted to rank. On the
    bright side you could create a custom tag to do this, with this custom tag in a
    list loop of the columns to rank and then just pass through the column name.

    Ken

    The ScareCrow Guest

  4. #3

    Default Re: Ranking of results?

    Yeah that's the only way I could see of doing it but I was hoping there was
    a more obvious/elegant way of doing it that I just wasn't seeing.

    Thanks Ken


    "The ScareCrow" <info@krcaldwell.com> wrote in message
    news:d5u5v8$eeg$1@forums.macromedia.com...
    > This would increase the processing, but off the top of my head.
    >
    > If you did a QoQ of the QoQ and do an order by the column this would give
    > you
    > the ranking order for that column, you could then loop through the result
    > set
    > and insert the ranking into the column.
    >
    > But you would need to do this for every column you wanted to rank. On the
    > bright side you could create a custom tag to do this, with this custom tag
    > in a
    > list loop of the columns to rank and then just pass through the column
    > name.
    >
    > Ken
    >

    Dave Guest

Posting Permissions

  • You may not post new threads
  • You may 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