Book description
Use window functions to write simpler, better, more efficient T-SQL queries
Most T-SQL developers recognize the value of window functions for data analysis calculations. But they can do far more, and recent optimizations make them even more powerful. In T-SQL Window Functions, renowned T-SQL expert Itzik Ben-Gan introduces breakthrough techniques for using them to handle many common T-SQL querying tasks with unprecedented elegance and power. Using extensive code examples, he guides you through window aggregate, ranking, distribution, offset, and ordered set functions. You'll find a detailed section on optimization, plus an extensive collection of business solutions — including novel techniques available in no other book.
Microsoft MVP Itzik Ben-Gan shows how to:
• Use window functions to improve queries you previously built with predicates
• Master essential SQL windowing concepts, and efficiently design window functions
• Effectively utilize partitioning, ordering, and framing
• Gain practical in-depth insight into window aggregate, ranking, offset, and statistical functions
• Understand how the SQL standard supports ordered set functions, and find working solutions for functions not yet available in the language
• Preview advanced Row Pattern Recognition (RPR) data analysis techniques
• Optimize window functions in SQL Server and Azure SQL Database, making the most of indexing, parallelism, and more
• Discover a full library of window function solutions for common business problems
About This Book
• For developers, DBAs, data analysts, data scientists, BI professionals, and power users familiar with T-SQL queries
• Addresses any edition of the SQL Server 2019 database engine or later, as well as Azure SQL Database
Get all code samples at: MicrosoftPressStore.com/TSQLWindowFunctions/downloads
Table of contents
- Cover Page
- Title Page
- Copyright Page
- Dedication Page
- Contents at a Glance
- Contents
- About the Author
- Introduction
- Chapter 1. SQL Windowing
- Chapter 2. A Detailed Look at Window Functions
- Chapter 3. Ordered Set Functions
- Chapter 4. Row-Pattern Recognition in SQL
- Chapter 5. Optimization of Window Functions
-
Chapter 6. T-SQL Solutions Using Window Functions
- Virtual Auxiliary Table of Numbers
- Sequences of Date and Time Values
- Sequences of Keys
- Paging
- Removing Duplicates
- Pivoting
- TOP N per Group
- Emulating IGNORE NULLS to Get the Last Non-NULL
- Mode
- Trimmed Mean
- Running Totals
- Max Concurrent Intervals
- Packing Intervals
- Gaps and Islands
- Median
- Conditional Aggregate
- Sorting Hierarchies
- Summary
- Index
- Code Snippets
Product information
- Title: T-SQL Window Functions: For data analysis and beyond, 2nd Edition
- Author(s):
- Release date: November 2019
- Publisher(s): Microsoft Press
- ISBN: 9780135861554
You might also like
book
SQL for Data Analysis
With the explosion of data, computing power, and cloud data warehouses, SQL has become an even …
book
Expert T-SQL Window Functions in SQL Server 2019: The Hidden Secret to Fast Analytic and Reporting Queries
Become an expert who can use window functions to solve T-SQL query problems. Replace slow cursors …
book
SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition
The #1 Easy, Common-Sense Guide to SQL Queries—Updated with More Advanced Techniques and Solutions Foreword by …
book
Definitive Guide to DAX, The: Business intelligence for Microsoft Power BI, SQL Server Analysis Services, and Excel, 2nd Edition
Now expanded and updated with modern best practices, this is the most complete guide to Microsoft's …