Use the NULLIF expressions for conditional expressions in Derby.
NULLIF ( L, R )The NULLIF expression is very similar to the CASE expression. For example:
NULLIF(V1,V2)is equivalent to the following CASE expression:
CASE WHEN V1=V2 THEN NULL ELSE V1 END