skip to main content
Non-Supported SQL-92 functionality : Value expressions : Advanced value expressions
 

Advanced value expressions

NULLIF

NULLIF is shorthand for a frequently used variation of CASE.

Syntax 

NULLIF(value1, target_value)
is equivalent to
CASE
WHEN value1 = = target_value THEN NULL
ELSE value1
END

Example 

... WHERE sales_revenue / NULLIF(our_cost, -1) > 50