PERCENT_RANK
window analytic
What changes
- Input
- ordered rows of the partition (frame for FIRST_VALUE/LAST_VALUE; offset rows for LAG/LEAD)
- Output or change
- one value per row
- Return type
- float(53)
Syntax at a glance
PERCENT_RANK( ) OVER ( [ partition_by_clause ] order_by_clause )
Work example
Compare the current rank position with its ordered partition.
Test a tie, partition boundary, and one-row partition. State the order and frame in the query.
Check your work A one-row partition returns zero and ties share a rank position.
Open Microsoft Learn for full syntax, permissions, and details for your version.