Analytic Functions (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2012)yesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

SQL Server supports these analytic functions:

CUME_DIST (Transact-SQL) LEAD (Transact-SQL)
FIRST_VALUE (Transact-SQL) PERCENTILE_CONT (Transact-SQL)
LAG (Transact-SQL) PERCENTILE_DISC (Transact-SQL)
LAST_VALUE (Transact-SQL) PERCENT_RANK (Transact-SQL)

Analytic functions calculate an aggregate value based on a group of rows. Unlike aggregate functions, however, analytic functions can return multiple rows for each group. Use analytic functions to compute moving averages, running totals, percentages or top-N results within a group.

See also

OVER Clause (Transact-SQL)