CHAPTER 3

image

Summarizing with Window Aggregates

One big difference between using window functions and aggregate queries is that you lose the details with aggregate queries. Starting with SQL Server 2005, you can eliminate that restriction by adding the OVER clause. By adding OVER, you may also eliminate the GROUP BY and HAVING clauses.

In this chapter, you will learn how to use window aggregate functions to easily add aggregate functions to non-aggregate queries. You will finish up the chapter by taking a look at some real-world problems.

Using Window Aggregates

Window aggregates are those favorite aggregate functions that you use every day, like ...

Get Expert T-SQL Window Functions in SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.