SQL Flow Field Guide

Ranking functions (overview)

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

none (documentation, rules or examples)

What changes

Input
none
Output or change
none

Syntax at a glance

n/a (reference page)

Work example

Assign row numbers or peer ranks within a partition for reports and top-per-group queries.

Decide whether ties share a rank and add a unique tie-breaker when row selection must be stable.

Check your work Ranking order defines rank values but does not order the final result set.

Open Microsoft Learn for full syntax, permissions, and details for your version.