Derived Tables
A derived table is similar to a Temporary table but derived from another SELECT statement.
When a subquery starts at the From clause (instead of Where), the result set is called Derived table.
Table invoices have around ten columns; our derived table 'tbl' has four columns.
Query with Case statements
'tbl' is the Table alias name. It can be anything. Just give a name for the output of the Derived query.
Derived Tables vs Sub Query
When the query is used with FROM clause, it's the DERIVED table.
When the query is used with a WHERE clause, it's Sub Query.
Sub Query
Derived Table
Last updated