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

Explain how can you save or place your msg in a table?

0 Answers  


What is insert command in sql?

0 Answers  


what are tables and fields? : Sql dba

0 Answers  


What is difference between mysql and postgresql?

0 Answers  


TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A 1 A 2 B 2 B 3 C 3 C 4 D 4 D 5 E 5 E 6 F 7 G HOW TO GET THE UNMATCHED RECORDS IN SQL QUERY?

10 Answers   Satyam,






What is a natural join sql?

0 Answers  


What is the importance of sqlcode and sqlerrm?

0 Answers  


What is trigger types in sql?

0 Answers  


What is PL/SQL Records?

0 Answers  


What is the maximum number of triggers,can apply to a single table?

2 Answers  


What is difference between pl and sql?

0 Answers  


Is full outer join same as cross join?

0 Answers  


Categories