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 ? | 65 Yes | 2 No |
Post New Answer View All Answers
What is the use of procedures?
What is meant by cursor in sql?
How do I trace sql profiler?
How do I run a sql script?
What are all ddl commands?
What does varchar include?
How delete all data from table in sql?
What are different types of tables in sql?
Is primary key clustered or nonclustered?
what are the authentication modes in sql server? : Sql dba
What are sql functions? Describe the different types of sql functions?
Which is faster count (*) or count 1?
What is difference between stored function and application function?
What are the two types of exceptions in pl/sql?
What is cte sql?