NULLIF function

The NULLIF function can be used for conditional expressions in Derby.

Syntax

NULLIF ( expression, expression )

The NULLIF function is very similar to the CASE expression. It returns NULL if the two arguments are equal, and it returns the first argument if they are not equal. For example,

NULLIF(V1,V2)

is equivalent to the following CASE expression:

CASE WHEN V1=V2 THEN NULL ELSE V1 END
Related reference
CASE expression
COALESCE function