In this SQL Tutorial, We will explore the NVL2() Function in Oracle.
What is NVL2() function in Oracle?
- NVL2() is another way to handling NULL value in Oracle.
- It is advanced version of NVL function.
- NVL2() function have functionality to handle both NULL Values and NOT NULL Values in Oracle.
Syntax of NVL2() function in Oracle
nvl2(value_to_check,value_to_not_null,value_to_null);
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;
SELECT NVL2('','found','Not Found') as nvl2_example FROM DUAL;
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.
0 Comments
If you have any doubts, Please let me know