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
How are sql commands classified?
what is a control file ? : Sql dba
Define SQL and state the differences between SQL and other conventional programming Languages?
what are all the different normalizations? : Sql dba
Is a view faster than a stored procedure?
What is before and after trigger?
what is blob? : Sql dba
How do I run a sql query?
What are the different dcl commands in sql?
Explain raise_application_error.
Is primary key a clustered index?
Which is better trigger or stored procedure?
In pl/sql, what is bulk binding, and when/how would it help performance?
Describe types of sql statements?
What is sql profiler in oracle?