Neoview SQL Reference Manual (R2.4 SP2)
NULLIF Function
The NULLIF function compares the value of two expressions. Both expressions must be of
comparable types. The return value is NULL when the two expressions are equal. Otherwise,
the return value is the value of the first expression.
NULLIF(expr1, expr2)
expr1
an expression to be compared.
expr2
an expression to be compared.
The NULLIF(expr1, expr2) is equivalent to:
CASE WHEN expr1 = expr2
THEN NULL
ELSE expr1
END
NULLIF returns a NULL if both arguments are equal. The return value is the value of the first
argument when the two expressions are not equal.
Example of NULLIF
This function returns a null if the value is equal to 7. The return value is the value of the first
argument when that value is not 7.
NULLIF(value,7)
422 SQL Functions and Expressions