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 constraints available in sql?
how to run 'mysql' commands from a batch file? : Sql dba
What are sql functions? Describe in brief different types of sql functions?
what is the difference between sql and t-sql? : Transact sql
Which is better stored procedure or query?
what is 'mysqlshow'? : Sql dba
Can we create foreign key without primary key?
what is a record in a database ? : Sql dba
Does pl/sql support create command?
what is bdb (berkeleydb)? : Sql dba
Is pl sql better than sql?
Explain the commit statement.
What is the order of sql select?
How do I send sql query results to excel?
How does left join work in sql?