real time applications of nullif?
Answers were Sorted based on User's Feedback
Answer / babu
nullif basically allows you to compare 2 expressions of
same datatype and return null if both are equal. else it
would return the first expression.eg:
nullif(10,10) returns null
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / rasmita basantia
The NULLIF function takes two arguments. If the two
arguments are equal, then NULL is returned. Otherwise, the
first argument is returned.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
what is union, minus and interact commands? : Sql dba
While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the output? How u will handle that error?
Which type of cursor is used to execute the dml statement?
What are the sql versions?
What is the difference between view and stored procedure?
Is natural join and inner join same?
What are the different operators available in sql?
what is sp_pkeys? : Transact sql
what is definer rights invoke rights?
how to fetch alternate records from a table? : Sql dba
What does t sql mean?
What is a dirty read sql?