adspace


real time applications of nullif?

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


Please Help Members By Posting Answers For Below Questions

what is bcp? When does it used? : Sql dba

1065


Do we need to rebuild index after truncate?

1154


how many tables will create when we create table, what are they? : Sql dba

1156


How do I remove duplicates in two columns?

1202


Is inner join faster than left join?

1287


what is collation? : Sql dba

1242


what is schema? : Sql dba

1163


Can we use distinct and group by together?

1146


What is the current version of postgresql?

1188


what are aggregate and scalar functions? : Sql dba

1142


Is primary key clustered index?

1028


What is the best sql course?

1064


how to use regular expression in pattern match conditions? : Sql dba

1125


define sql insert statement ? : Sql dba

1110


how to start mysql server? : Sql dba

1279