NULLIFZERO

Purpose

This function returns the value NULL if number has value 0. Otherwise, a number is returned.

Syntax

nullifzero::=

Usage Notes

  • The NULLIFZERO function is equivalent to the CASE expression CASE WHEN number=0 THEN NULL ELSE number END.
  • Additionally, refer to ZEROIFNULL.

Example

SELECT NULLIFZERO(0) NIZ1, NULLIFZERO(1) NIZ2;