User's Guide
PART 1. Working with Databases
When you create a query, you use WHERE and HAVING clauses to restrict the rows that the query will display.
Sometimes, the rows you select depend on information stored in more than one table. A subquery in the WHERE or HAVING clause allows you to select rows from one table according to specifications obtained from another table. Additional ways to do this can be found in .
This chapter assumes some knowledge of queries and the syntax of the select statement. Information about queries is located in Queries: Selecting Data from a Table.
What is a subquery?
Using Subqueries in the WHERE clause
Subqueries in the HAVING clause
Subquery comparison test
Quantified comparison tests with ANY and ALL
Testing set membership with IN conditions
Existence test
Outer references
Subqueries and joins
Nested subqueries
How subqueries work