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 create an array in pl/sql?
what is a tablespace? : Sql dba
Which is faster view or stored procedure?
What are records give examples?
Why are cursors used?
What are the dml statements?
Do prepared statements prevent sql injection?
How to rename a column in the output of sql query?
what is the difference between clustered and non clustered index in sql? : Sql dba
explain advantages of myisam over innodb? : Sql dba
What is the difference between delete and truncate statement in sql?
How does cross join work?
How do I restart sql?
What are the two parts of design view?
What is query execution plan in sql?