O'Reilly logo

SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach by Jonathan Gennick, Wayne Sheffield, Andy Roberts, David Dye, Jason Brimhall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

image

Querying from Multiple Tables

by Jonathan Gennick

It is the rare database that has all its data in a single table. Data tends to be spread over multiple tables in ways that optimize storage and ensure consistency and integrity. Part of your job when writing a query is to deploy and link together T-SQL operations that can operate across tables in order to generate needed business results.

Building blocks at your disposal include:

  • Joins. Imagine holding two spreadsheets side by side. A join takes two rowsets and combines the rows from each to create a single rowset having the combined columns. Look towards a join when you want to correlate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required