The scalar_expression_1 argument may be evaluated twice: once as part of the search condition (see the preceding expanded CASE expression) and again as a return value for the ELSE clause.
Using a nondeterministic function, such as RANDOM, may have unexpected results if the first calculation of scalar_expression_1 is not equal to scalar_expression_2, in which case the result of the CASE expression is the value of the second calculation of scalar_expression_1, which may be equal to scalar_expression_2.
You can use a scalar subquery in a NULLIF expression. However, if you use a non-scalar subquery (a subquery that returns more than one row), a runtime error is returned.
The following restrictions apply to CLOB, BLOB, and UDT types in a NULLIF expression.
Data Type | Restrictions |
---|---|
BLOB | A BLOB can only appear in the argument list when cast to BYTE or VARBYTE. |
CLOB | A CLOB can only appear in the argument list when cast to CHAR or VARCHAR. |
UDT | Multiple UDTs in the argument list must have identical types and an ordering definition. |