Even after six years, I am still presenting at user groups and SQL Saturdays on T-SQL windowing functions. I have found that many data professionals haven’t heard about these great functions. Lots of folks are using ROW_NUMBER, but most haven’t heard about LAG, for example. I recently decided to write a couple of articles for Simple-Talk to give a quick introduction.
The first article, Introduction to T-SQL Window Functions, describes each type of function along with an example or two of each. The second article, T-SQL Window Functions and Performance, tells you what you need to know to get good performance when using these functions.
To learn even more, take a look at my book or my Pluralsight course. These functions simplify many types of queries. If you are writing queries for SQL Server databases, the window function feature is worth checking out!