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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-84
Comparison Predicates
Comparison Predicates
Considerations for Comparison Predicates
Examples of Comparison Predicates
A comparison predicate compares the values of sequences of expressions, or the
values of sequences of row values that are the result of row subqueries.
row-value-constructor
specifies an operand of a comparison predicate. The two operands can be either of
these:
(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.
The two row-value-constructors must contain the same number of elements.
That is, the number of value expressions in each list, or the number of values
returned by a row subquery, must be the same.
The data types of the respective values of the two row-value-constructors
must be comparable. (Respective values are values with the same ordinal position
in the two lists.) See Comparable and Compatible Data Types on page 6-16.
row-value-constructor comparison-op row-value-constructor
comparison-op is:
= Equal
| <> Not equal
| < Less than
| > Greater than
| <= Less than or equal to
| >= Greater than or equal to
row-value-constructor is:
(expression [,expression]...)
| row-subquery