Chapter 7. Beyond the fundamentals of querying

This chapter covers querying topics that go beyond the fundamentals and is provided as optional reading. It starts with the powerful window functions, which you can use to apply data-analysis calculations in a flexible and efficient manner. The chapter continues with techniques for pivoting and unpivoting data. Pivoting rotates data from a state of rows to columns, and unpivoting rotates data from columns to rows, similar to pivot tables in Excel. The chapter finishes with a discussion about grouping sets, which are the sets of expressions that you group the data by. It covers techniques for defining multiple grouping sets in the same query.

What’s common to the features covered in this chapter, ...

Get T-SQL Fundamentals, Third Edition 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.