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
Why is %isopen always false for an implicit cursor?
Is a view faster than a stored procedure?
What is an escape character in sql?
When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?
How can I tell if sql is running?
Is pl sql still used?
What is meant by user defined function?
What is database sql?
Can you selectively load only those records that you need? : aql loader
What are the different types of functions in sql?
Does sql*plus have a pl/sql engine?
What is sql dialect?
What is the most restrictive isolation level? : Transact sql
What is difference between hql and native sql?
What is varchar data type in sql?