Apply powerful window functions in T-SQL—and increase the performance and speed of your queries
Optimize your queries—and obtain simple and elegant solutions to a variety of problems—using window functions in Transact-SQL. Led by T-SQL expert Itzik Ben-Gan, you’ll learn how to apply calculations against sets of rows in a flexible, clear, and efficient manner. Ideal whether you’re a database administrator or developer, this practical guide demonstrates ways to use more than a dozen T-SQL querying solutions to address common business tasks.
Discover how to:
Go beyond traditional query approaches to express set calculations more efficiently Delve into ordered set functions such as rank, distribution, and offset Implement hypothetical set and inverse distribution functions in standard SQL Use strategies for improving sequencing, paging, filtering, and pivoting Increase query speed using partitioning, ordering, and coverage indexing Apply new optimization iterators such as Window Spool Handle common issues such as running totals, intervals, medians, and gaps
Itzik Ben-Gan is a Mentor and Co-Founder of SolidQ. A SQL Server Microsoft MVP (Most Valuable Professional) since 1999, Itzik has delivered numerous training events around the world focused on T-SQL Querying, Query Tuning and Programming. Itzik is the author of several books including Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions and Microsoft SQL Server 2012 T-SQL Fundamentals. He has written articles for SQL Server Pro, SolidQ Journal and MSDN. Itzik's speaking activities include TechEd, SQLPASS, SQLU, SQLTeach and various user groups around the world. Itzik is the author of SolidQ's Advanced T-SQL Querying, Programming and Tuning and T-SQL Fundamentals courses along with being a primary resource within the company for their T-SQL related activities.
Itzik Ben-Gan is a co-founder of Solid Quality Mentors, a technical education company, and is a Microsoft SQL Server MVP.
Whether you've never used window functions in your life and are looking to learn about them, or you've been using them occasionally and are looking to systematize your knowledge, or even if you've been using them all the time, you are going to benefit from reading this book. It starts with an explanation of theory, throws in a few practical examples to whet your appetite, covers each individual function in depth, and provides a plethora of examples to keep you going; all in a very clear, methodical, and thorough Ben-Gan fashion. My only gripe is that the author is too enthusiastic to show "alternative" ways to address problems, which usually means standard, pre-window functions SQL. While this is not useless or uninteresting information, I doubt someone would intentionally pick up a book on window functions when looking for ways on how to do without them! It would be more beneficial to include additional examples of real-life problems instead (the ones included are great, but if you have prior window experience with window functions, you've probably seen and used most of them already). Still, this is a minor gripe which in no way detracts from the overall value of the book. If window functions is something you want to learn about, this is a great resource.