SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
N-6
NULL Predicate
NULL Predicate
NULL is a predicate that determines whether a column contains a null value.
Considerations—NULL
If any expression in the NULL predicate evaluates to a value other than null, the IS
NOT NULL predicate evaluates to TRUE; otherwise, IS NOT NULL evaluates to
FALSE.
This chart summarizes expression evaluation for null predicates. rvs stands for
row value specification. Degree is the number of expressions in row value
specification.
Note that the expression
row-value-specification IS NOT NULL
is not equivalent to the expression
NOT ( row-value-specification IS NULL )
If all the expressions in the NULL predicate evaluate to null, the IS NULL predicate
evaluates to TRUE; otherwise, IS NULL evaluates to FALSE.
Examples—NULL
This example finds all rows with a null value in the SALARY column:
SALARY IS NULL
row-value-specification IS [ NOT ] NULL
row-value-specification is:
{ expression [, expression ] ... }
{ ( expression [, expression ] ... ) }
Expression
rvs is
NULL
rvs is NOT
NULL
NOT rvs is
NULL
NOT rvs is
NOT NULL
degree 1:
null
TRUE FALSE FALSE TRUE
degree 1:
not null
FALSE TRUE TRUE FALSE
degree>1:
all null
TRUE FALSE FALSE TRUE
degree>1:
some null
FALSE FALSE TRUE TRUE
degree>1:
none null
FALSE TRUE TRUE FALSE