Difference between NVL, NVL2 and NULLIF

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is linq to sql?

552


What is a function in oracle pl sql?

540


What are different functions in sql?

516


What is normalization in a database?

612


What is oracle sql called?

505






How is sql used in oracle?

581


How to Execute a Package in PL/SQL.?

585


What are all the ddl commands?

627


How do I debug a stored procedure?

627


What is the maximum size of sqlite database?

547


What is a dynamic query?

571


How do I count records in sql?

515


Mention what are the benefits of pl/sql packages?

535


Is sql similar to python?

538


What is left join in postgresql?

540