SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-97
Quantified Comparison Predicates
Quantified Comparison Predicates
Considerations for ALL, ANY, SOME
Examples of ALL, ANY, SOME
A quantified comparison predicate compares the values of sequences of expressions
to the values in each row selected by a table subquery. The comparison operation is
quantified by the logical quantifiers ALL, ANY, or SOME.
row-value-constructor
specifies the first operand of a quantified comparison predicate. The first operand
can be either of:
(expression [,expression ]...)
is a sequence of SQL value expressions, separated by commas and enclosed
in parentheses. expression cannot include an aggregate function unless
expression is in a HAVING clause. expression can be a scalar subquery
(a subquery that returns a single row consisting of a single column). See
Expressions on page 6-37.
row-subquery
is a subquery that returns a single row (consisting of a sequence of values).
See Subquery on page 6-105.
ALL
specifies that the predicate is true if the comparison is true for every row selected
by table-subquery (or if table-subquery selects no rows), and specifies that
the predicate is false if the comparison is false for at least one row selected.
row-value-constructor comparison-op quantifier table-subquery
row-value-constructor is:
(expression [,expression]...)
| row-subquery
comparison-op is:
= Equal
| <> Not equal
| != Not equal
| < Less than
| > Greater than
| <= Less than or equal to
| >= Greater than or equal to
quantifier is:
ALL | ANY | SOME