Oracle NULLIF() Function

Share on:

Oracle NULLIF() Function:

The Oracle NULLIF() function accepts only two arguments. If the both arguments are equal it returns a null value. In case the arguments are not equal, the NULLIF() function returns the first argument and if any arguments will null then function return an error.

  • Syntax of the NULLIF() function:
1NULLIF(elm1, elm2)

Example 1:

1SELECT
2NULLIF ('VIKAS', 'PANDEY') COL
3FROM DUAL

Preview

Example 2:

1SELECT
2NULLIF ('VIKAS', 'VIKAS') COL
3FROM DUAL

Preview

Example 3:

1SELECT
2NULLIF (null, 'VIKAS') COL
3FROM DUAL

Preview

You might also like: