Chapter 4. Subqueries
In this chapter:
SQL supports writing queries within queries, or nesting queries. The outermost query is a query whose result set is returned to the caller and is known as the outer query. The inner query is a query whose result is used by the outer query and is known as a subquery. The inner query acts in place of an expression that is based on constants or variables and is evaluated at run time. Unlike using constants in your expressions, the result of a subquery may change because of changes in the queried tables. By using subqueries you avoid the need for separate steps in your solutions that store ...