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 is dense_rank in sql?
What are the types of variables use in pl sql?
What is before trigger?
Could you please provide oca (oracle 10g) dumps for my certification ?
How to read/write files from pl/sql?
how many ways to get the current time? : Sql dba
How to pipe multiline string to isql?
What is a unique constraint?
what is the difference between nested subquery and correlated subquery?
What is composite data type in pl sql?
what are all the different normalizations? : Sql dba
Explain table and field in sql?
What is the advantage of index in sql?
Explain alias in sql?
What is the difference between inner join and outer join?