Appendix B. Select—Advanced Queries

The advanced queries include subqueries, pivot, rollup and cube.

Most examples in this section indicate whether the Microsoft SQL Server being shown does or does not comply with SQL-92, the ANSI Standard. Sometimes there are two ways of correctly getting the same result with the same performance, in which case it is useful to know if one way is portable to other RDBMS systems. Sometimes one has to write nonportable code to get the job done, but striving for portability is desirable.

Some of the examples later in the appendix are presented as exercises with the solutions provided later in the text. Unlike the body of the book, which is primarily intended as a reference, the tutorial approach used here is to ...

Get Transact-SQL Desk Reference 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.