SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual523725-004
6-100
Quantified Comparison Predicates
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-39.
row-subquery
is a subquery that returns a single row (consisting of a sequence of values).
See Subquery on page 6-108.
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.
ANY | SOME
specifies that the predicate is true if the comparison is true for at least one row
selected by the table-subquery and specifies that the predicate is false if the
comparison is false for every row selected (or if table-subquery selects no
rows).
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