Derived table

A derived table is a SELECT statement included in the FROM clause of a query. The result set of the SELECT statement is logically treated as if it were a table. The query optimizer may also generate derived tables during query rewrites, for example in queries including the set based operations UNION, INTERSECT, or EXCEPT. The graphical plan displays the name of the derived table and the list of columns that were computed.

For more information on derived tables, see and .

Example 

The following query of the sample database has derived tables in its graphical plan:

SELECT emp_id FROM employee
UNION ALL
SELECT dept_id FROM (    
    SELECT TOP 5 dept_id
    FROM department
    ORDER BY dept_name DESC ) MyDerivedTable