Database Reference
In-Depth Information
Figure 12.1
Subquery
Comparison
Condition Syntax.
A subquery itself is generally syntactically equivalent to a SELECT state-
ment. Chapters 4, 5, 6, and 11 apply to subqueries in this respect.
So far in this chapter, we have seen a lot of information. The easiest way
to explain subqueries is simply to demonstrate.
12.4
Demonstrating Subqueries
This section demonstrates use of the different types of subqueries:
Single-row subqueries.
Multiple-row subqueries.
Multiple-column subqueries.
Regular versus correlated subqueries.
Nested subqueries.
Inline views or FROM clause embedded subqueries.
Subqueries can be used in numerous SQL code commands and their
subset clauses.
12.4.1
Single-Row Subqueries
A single-row subquery is exactly as its name implies: a subquery that returns
a single row. If more than one row is returned, an error will result (ORA-
01427: single-row subquery returns more than one row). Simple (equality),
LIKE, and Range (BETWEEN) comparison conditions are restricted to
single-row subquery results. See the syntax diagram in Figure 12.1.
Search WWH ::




Custom Search