FROM derived table
nested query used as a table
What changes
- Input
- the inner query's sources
- Output or change
- rowset under an alias
Syntax at a glance
FROM ( subquery ) [ AS ] table_alias [ ( column_alias [ ,...n ] ) ]
Work example
One query needs to shape a rowset before the outer query joins or filters it.
Give the derived table an alias and name its projected columns. Compare the inner result before adding the outer query.
Check your work FROM derived table. The outer query sees only the derived table's output columns and returns the expected rows.
Open Microsoft Learn for full syntax, permissions, and details for your version.