Book Review: Expert T-SQL Window Functions in SQL Server | @CloudExpo #API #Cloud #TSQL #SQLServer

There is an old saying that good things come in small packages. This saying definitely applies to this book, which focuses in on a set of functions that most people are not aware of that are available in SQL Server. To start off with we need to answer the following question: What are T-SQL Window functions? These functions have nothing to do with the Microsoft Windows API. They are in essence a way to create a window into your data as you process each line in a query. Their strength lies in the ease with which you can solve tricky queries. The authors also point out that these functions don’t add any new functionality per se as you could create the queries the old way; however, in general the functions are much more efficient. One very neat capability of these functions is to allow you to include non-aggregated columns in an aggregated query, which is a big limitation with existing aggregate functions. These Window functions make it easy to calculate running totals, moving averages and more. Also starting with SQL Server 2012, you can add an order by to window aggregates to calculate running totals.

read more