Answer Posted / avi007
In Oracle/PLSQL, the NULLIF function compares expr1 and
expr2. If expr1 and expr2 are equal, the NULLIF function
returns NULL. Otherwise, it returns expr1.
The syntax for the NULLIF function is:
NULLIF( expr1, expr2 )
expr1 and expr2 must be either numeric values or values
that are of the same datatype.
For example:
NULLIF(12, 12) would return NULL
NULLIF(12, 13) would return 12
NULLIF('apples', 'apples') would return NULL
NULLIF('apples', 'oranges') would return 'apples'
NULLIF(NULL, 12) would return an ORA-00932 error because
expr1 can not be the literal NULL
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Define commit, rollback and savepoint?
Can we debug stored procedure?
What does partition by mean in sql?
What is group by in sql?
Which is faster truncate or drop?
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?
Does truncate remove indexes?
Can you join views in sql?
What is the primary use of normalization?
what are the security recommendations while using mysql? : Sql dba
when is the use of update_statistics command? : Sql dba
What is the difference between partition and index?
How do you remove duplicate records from a table?
which command using query analyzer will give you the version of sql server and operating system? : Sql dba