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 a stored procedure in sql with example?

784


Is left join inner or outer by default?

761


What is the basic structure of an sql?

757


What does sign mean sql?

760


Which software is used for pl sql programming?

680






What does select top 1 do in sql?

729


what are enums used for in mysql? : Sql dba

816


What is sqlservr exe?

697


What is the use of pl/sql table?

757


how would you get the current date in mysql? : Sql dba

724


why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba

786


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

747


What is trigger explain it?

740


what are integrity rules?

754


Write a query to find the names of users that begin with "um" in sql?

703