Quantified Comparison Predicates - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

If all of the expressions in the row-value-constructor are null, the IS NULL predicate is
true. Otherwise, it is false. If none of the expressions in the row-value-constructor are null,
the IS NOT NULL predicate is true. Otherwise, it is false.
Considerations for NULL
Summary of NULL Results
Let rvc be the value of the row-value-constructor. This table summarizes the results of
NULL predicates. The degree of a rvc is the number of values in the rvc.
Expressions
degree 1: null
degree 1: not null
degree>1: all null
degree>1: some null
degree>1: none null
Note that the rvc IS NOT NULL predicate is not equivalent to NOT rvc IS NULL.
Examples of NULL
Find all rows with null in the SALARY column:
salary IS NULL
This predicate evaluates to true if the expression (PRICE + TAX) evaluates to null:
(price + tax) IS NULL
Find all rows where both FIRST_NAME and SALARY are null:
(first_name, salary) IS NULL

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 comparison-op quantifier table-subquery
row-value-constructor is:
(expression [,expression]...)
| row-subquery
comparison-op is:
=
| <>
| !=
| <
| >
| <=
| >=
quantifier is:
ALL | ANY | SOME
rvc IS NULL
TRUE
FALSE
TRUE
FALSE
FALSE
Equal
Not equal
Not equal
Less than
Greater than
Less than or equal to
Greater than or equal to
rvc IS NOT NULL
NOT rvcIS NULL
FALSE
FALSE
TRUE
TRUE
FALSE
FALSE
FALSE
TRUE
TRUE
TRUE
NOT rvc IS NOT
NULL
TRUE
FALSE
TRUE
TRUE
FALSE
Predicates
297

Advertisement

Table of Contents
loading

Table of Contents