The latest version of SQL Server augments T-SQL with many new functions. In this section, we cover the 22 new functions (and 1 changed function) introduced in SQL Server 2012. We’ll start by covering the new T-SQL analytic functions, because they operate using the same windowing principles we were just discussing.
Eight new analytic functions have been added to T-SQL. All of them work in conjunction with an ordered window defined with an associated ORDER BY clause that can be optionally partitioned with a PARTITION BY clause and framed with a BETWEEN clause. The new functions are:
In Example 2-32, the FIRST_VALUE, ...