Chapter 3

Joins

The FROM clause of a query is the first clause to be logically processed, and within the FROM clause, table operators operate on input tables. T-SQL supports four table operators: JOIN, APPLY, PIVOT, and UNPIVOT. The JOIN table operator is standard, whereas APPLY, PIVOT, and UNPIVOT are T-SQL extensions to the standard. Each table operator acts on tables provided to it as input, applies a set of logical query processing phases, and returns a table result. This chapter focuses on the JOIN table operator. The APPLY operator will be covered in Chapter 5, “Table expressions,” and the PIVOT and UNPIVOT operators will be covered in Chapter 7, “T-SQL for data analysis.

A JOIN table operator operates on two input tables. The three fundamental ...

Get T-SQL Fundamentals, 4th 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.