| title | Analytic Functions (Transact-SQL) | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 07/24/2017 | |
| ms.prod | sql | |
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | |
| ms.reviewer | ||
| ms.technology | t-sql | |
| ms.topic | language-reference | |
| dev_langs |
|
|
| ms.assetid | 60fbff84-673b-48ea-9254-6ecdad20e7fe | |
| author | MikeRayMSFT | |
| ms.author | mikeray | |
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDEtsql-appliesto-ss2012-all-md]
SQL Server supports these analytic functions:
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.