Chapter 9. Advanced Data Retrieval

After completing this chapter, you will be able to

  • Aggregate data

  • Filter aggregates

  • Query common table expressions

  • Combine multiple result sets

  • Find matching rows between two tables

  • Find rows that exist in one table and not in another

  • Calculate multi-level aggregates

  • Query XML data

In Chapter 8, you learned about the basic clauses available for a SELECT statement that can be used to solve a variety of business problems. In this chapter, we will delve into advanced features and recent extensions to a SELECT statement that allow you to calculate aggregates, aggregate result sets, manipulate hierarchies, find matching/nonmatching rows between tables, and query XML data.

Note

Each chapter within this book has multiple procedures ...

Get Microsoft® SQL Server® 2008 Step by Step 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.