CHAPTER 6

image

Adding Frames to the Window

You have looked through the window and used it to write some powerful queries. You have partitioned it like the smaller panes in a large window. Now you will learn how to create very granular windows, much like stained glass, with frames.

In this chapter, you will learn how framing, where it is supported, is so important to the performance of the queries and the accuracy of the results.

Understanding Framing

When the 2012 T-SQL features were first announced back in 2011, I must confess that framing intimidated me a bit. I didn’t really like the syntax and didn’t quite understand what was going on. Luckily, ...

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.