Single-valued subqueries
You do not need to include the keyword ALL or ANY if you know the subquery can return exactly one value to the outer-level query. A subquery that returns exactly one value can be treated like a function. This kind of subquery often uses an aggregate function because aggregate functions always return single values.
The
following query uses the aggregate function MAX in
a subquery to find the order_num for orders that include the
maximum number of volleyball nets.
The following query uses the aggregate function MIN in
the subquery to select items for which the total price is higher than
10 times the minimum price.