real time applications of nullif?

Answers were Sorted based on User's Feedback



real time applications of nullif?..

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

real time applications of nullif?..

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

real time applications of nullif?..

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

Post New Answer

More SQL PLSQL Interview Questions

Can we use distinct and group by together?

0 Answers  


What can sql server reporting services do?

0 Answers  


what are dynamic queries in t-sql? : Transact sql

0 Answers  


Is sql harder than python?

0 Answers  


How do I find duplicates in sql?

0 Answers  






What are the 3 modes of parameter?

0 Answers  


what are ddl statements in mysql? : Sql dba

0 Answers  


Explain what is a field in a database and record in a database?

0 Answers  


What is restrict in sql?

0 Answers  


How to sort the rows in sql.

0 Answers  


What view means?

0 Answers  


What is the result, when NULL is compared with NULL?

22 Answers   TCS,


Categories