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

wht is the difference between sqlaserver2000 and 2005

1 Answers   ABC, IBM,


How do temporal tables work?

0 Answers  


Explain the usage of WHERE CURRENT OF clause in cursors ?

3 Answers  


what is the different between now() and current_date()? : Sql dba

0 Answers  


Write a sql query to convert all character to uppercase after hypen.

0 Answers  






Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

0 Answers  


how to retrieve the top 2 salaried persons from a database?

7 Answers   Orion Laboratories,


can use the following like overloading concept in a single package: procedure p1(a varchar), procedure p1(a varchar2), procedure p1(a char)

5 Answers  


How many null values can be inserted in a coulmn whihc is unique constraint

8 Answers   Flextronics,


What are the advantages of pl sql?

0 Answers  


what is a trigger in mysql? Define different types of trigger. : Sql dba

0 Answers  


what is oltp (online transaction processing)? : Sql dba

0 Answers  


Categories