FROM plus JOIN, APPLY, PIVOT
binds sources and composes them with joins, APPLY, PIVOT, UNPIVOT
What changes
- Input
- tables, views, CTEs, derived tables, TVFs, rowset functions, OPENXML, VALUES, variables
- Output or change
- the working rowset for later steps
Syntax at a glance
[ FROM { <table_source> } [ , ...n ] ]
Work example
A report draws rows from named sources and combines them before filtering or projection.
Begin with one source. Add a join only after stating its key and expected match count for each input row.
Check your work FROM plus JOIN, APPLY, PIVOT. The joined row count matches the expected key cardinality. Unmatched rows appear only where the join type allows them.
Open Microsoft Learn for full syntax, permissions, and details for your version.