ranking a fields value

  • Is there a function I can use to rank values in TSQL so that the values will be sorted in descending order and the highest value (even if there is more than one all will have the same rank) will be ranked 1 . Sort of like the following:

    Value Ranking

    200 1

    200 1

    150 2

    143 3

    143 3

    143 3

    100 4

  • Never ming the above question. They were actually wanting to calculate a percentile of the values so if someone could advise on how to go about calculating a percentile?

  • dndaughtery (5/7/2009)


    Never ming the above question. They were actually wanting to calculate a percentile of the values so if someone could advise on how to go about calculating a percentile?

    Post the expected output


    Madhivanan

    Failing to plan is Planning to fail

  • Look up Books Online for Ranking Functions

    --Ramesh


Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply