Subqueries
- Last Updated: March 14, 2016
- 1 minute read
- DataDirect Connectors
- JDBC
- Salesforce 6.0
- Documentation
A query is an operation that retrieves data from one or more tables or views. In this reference, a top-level query is called a Select statement, and a query nested within a Select statement is called a subquery.
A subquery is a query expression that appears in the body of another expression such as a Select, an Update, or a Delete statement. In the following example, the second Select statement is a subquery:
SELECT * FROM emp WHERE deptno IN
(SELECT deptno FROM dept)