July 2012
Intermediate to advanced
816 pages
27h 38m
English
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:
FIRST_VALUE
LAST_VALUE
LAG
LEAD
PERCENT_RANK
CUME_DIST
PERCENTILE_CONT
PERCENTILE_DISC
In Example 2-32, the FIRST_VALUE, ...
Read now
Unlock full access