NVL2() Function in Oracle

In this SQL Tutorial, We will explore the NVL2() Function in Oracle.

NVL2 function in oracle sql

What is NVL2() function in Oracle?

  1. NVL2() is another way to handling NULL value in Oracle.
  2. It is advanced version of NVL function.
  3. NVL2() function have functionality to handle both NULL Values and NOT NULL Values in Oracle.

Syntax of NVL2() function in Oracle


In NVL2() function used three parameter first parameter check the value if it return not null values then second parameter executed if first parameter return null values then third parameter executed.

Example of NVL2() function in Oracle

SELECT NVL2('Javainhand Tutorial','found','Not Found') as nvl2_example FROM DUAL;

nvl2 in oracle example

SELECT NVL2('','found','Not Found') as nvl2_example FROM DUAL;

nvl2 function in oracle sql with example

That's all for today, I think(NVL2() Function in Oracle) post will be helpful for you. If you like the post then share your view in the comment box.

Post a Comment