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 identity column in sql server?

0 Answers  


Can you do multiple joins in sql?

0 Answers  


Does postgresql run on the cloud?

0 Answers  


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

0 Answers  


What is primary key and foreign key with example?

0 Answers  






How to select all records from the table?

0 Answers  


What is the use of procedures?

0 Answers  


how to delete duplicate rows from a specified table(only single table) how do you know which join is need to be used

11 Answers   UST,


How can we implement rollback or commit statement in a trigger?

0 Answers  


What is crud sql?

0 Answers  


what is 'force view'?

3 Answers   Cap Gemini, SPIC,


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

0 Answers  


Categories