You've just got to love some of the contradictions found in Microsoft documentation. First, they say (emphasis is mine)...
The range of values returned by PERCENT_RANK is greater than 0 and less than or equal to 1.
In the very next sentence, they say...
The first row in any set has a PERCENT_RANK of 0.
Asking the obvious rhetorical question, is the first row considered to NOT be a part of the range they speak of?
is pronounced "ree-bar
" and is a "Modenism
" for R
ow.First step towards the paradigm shift of writing Set Based code:________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
Dear Lord... I'm a production DBA. Please grant me patience because, if you grant me strength, I'm gonna need bail money to go with it.
Helpful Links:How to post code problemsHow to Post Performance ProblemsCreate a Tally Function (fnTally)