Subquery
A subquery is a query nested inside another query.
Types of subqueries
The SQL standard defines three types of subqueries:
- Row subqueries. These are those that return more than one column but a single row.
- Table subqueries. Are those that return one or more columns and zero or more rows.
- Scalar subqueries. Are those that return one column and one row.
Subqueries can be nested in any part of the SELECT syntax:
References