Window functions are used in SQL Server to perform data-analysis calculations. A data-analysis calculation is one you apply to a set of rows that returns a single value. Aggregate calculations fall under this category. In contrast to group functions which are applied to groups of rows defined by a grouped query, window functions are applied to windows of rows defined by a windowed query.
Window functions fall under four categories:
Standard SQL provides extensive coverage of window functions SQL Server’s T-SQL implements a subset of the standard. Window functions are fairly new to SQL Server. Some of them were introduced in SQL Server 2012.