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
What are the various levels of constraints?
What are the differences between in and exists clause?
Where can I learn sql for free?
What does trigger mean in slang?
what are the drivers in mysql? : Sql dba
What is sql injection vulnerability?
What will you get by the cursor attribute sql%rowcount?
When you have to use a default "rollback to" savepoint of plvlog?
How do you remove duplicates without using distinct in sql?
Which is faster view or stored procedure?
What is procedure explain with program?
Which is faster subquery or join?
What is crud stand for?
Why do you partition data?
What are different sql data types?