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
How to get help at the sql prompt?
explain advantages of myisam over innodb? : Sql dba
what are the advantages of using stored procedures? : Sql dba
Can a varchar be a primary key?
Which are the different case manipulation functions in sql?
what is the difference between inner and outer join? Explain with example. : Sql dba
Mention what is the plv (pl/vision) package offers?
Can dml statements be used in pl/sql?
Can you join a table to itself?
How can you fetch common records from two tables?
Is json a nosql?
What is a join?
What are packages in pl sql and also explain its advantages?
What is meant by user defined function?
What are dml commands?