Home |
Previous Page | Next Page Composing Advanced SELECT Statements > Subqueries in SELECT Statements >
You can construct a SELECT statement
with a subquery to replace two separate SELECT statements.
Subqueries in SELECT statements allow
you to perform the following actions:
- Compare an expression to the result of another SELECT statement
- Determine whether the results of another SELECT statement
include an expression
- Determine whether another SELECT statement
selects any rows
An optional WHERE clause in a subquery
is often used to narrow the search condition.
A subquery selects and returns values to the first or outer SELECT statement.
A subquery can return no value, a single value, or a set of values,
as follows:
- If a subquery returns no value, the
query does not return any rows. Such a subquery is equivalent to
a NULL value.
- If a subquery returns one value, the
value is in the form of either one aggregate expression or exactly
one row and one column. Such a subquery is equivalent to a single
number or character value.
- If a subquery returns a list or set of
values, the values represent either one row or one column.
Home |
[ Top of Page | Previous Page | Next Page | Contents |
Index ]