PERCENT_RANK

Calculates the relative rank of a row within a group of rows. Use PERCENT_RANK to evaluate the relative standing of a value within a query result set or partition.

Syntax

PERCENT_RANK( )
    OVER ( [ partition_by_clause ] order_by_clause )

Arguments

None.

Return types

float

Example

SELECT PERCENT_RANK() OVER(ORDER BY [IntColumn]) AS [ReturnValuePercentRank]
  FROM [IntTable]