Difference between NVL, NVL2 and NULLIF



Difference between NVL, NVL2 and NULLIF..

Answer / sushma s

NVL function substitute a value when a null value is
encountered.
NVL2: substitutes a value when a null value is encountered
as well as when a non-null value is encountered.

The syntax for the NVL2 function is:

NVL2( string1, value_if_NOT_null, value_if_null )

string1 is the string to test for a null value.

value_if_NOT_null is the value returned if string1 is not null.

value_if_null is the value returned if string1 is null.

NULLIF: NULLIF function compares expr1 and expr2. If expr1
and expr2 are equal, the NULLIF function returns NULL.
Otherwise, it returns expr1.

Is This Answer Correct ?    64 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

What is sql query limit?

0 Answers  


Why sql query is slow?

0 Answers  


What is sql integrity?

0 Answers  


Is microsoft sql free?

0 Answers  


how can i read files from a pl/sq l program

3 Answers  






What is Highwatermark?

3 Answers   Thermotech,


what are %TYPE and %ROWTYPE? what is the difference?

7 Answers   ICICI, Saama Tech, Sail,


How does cross join work?

0 Answers  


What is user define exception and example

1 Answers   HP, KP,


How do I enable sql encryption?

0 Answers  


explain what is mysql? : Sql dba

0 Answers  


What is trigger and how to use it in sql?

0 Answers  


Categories