![]() |
IT-Interview.com:Open Database for IT Professionals to share interview questions, answers and knowledge. |
![]() |
IT-Interview.com:Open Database for IT Professionals to share interview questions, answers and knowledge. |
Best Answer ! ! !
Sybtax:- - nvl2(expr1,expr2,expr3)In nvl2 if expr1 evaluates to NULL then expr3 is returned and if it evaluates to some value it returns expr2.for e.g select nvl2(commission_pct,'SAL COMM','SAL') from employees;if commission_pct is having null value then SAL will be displayed else SAL COMM.
SYNTAX FOR NVL2(EXPR1 EXPR2 EXPR3);
NVL2
aj5122003 answered on£ºJun 11, 2009 0 comments 
nvl2-- can take three arguments
by using this we can convert null to values
nvl(a b c)
if a is null it will display c
if a is not null it ll display b
uglywoman answered on£ºJun 12, 2009 0 comments 
Hi everybody
This is new features in 9i
NVL means select nvl(comm 0) from tablename;
we r selecting a column comm that contain null values then it will be give by o or any specific name that u want
in NVL2 means select NVL2(comm sal comm sal) frm tab_name
if first exp is true it will give sal only otherwise it will give sal comm.
Regards
Pawan Ahuja
mrhandsomeabit answered on£ºJun 13, 2009 0 comments 
Eg;NVL(comm null) it takes null value as zero
nexttime answered on£ºJun 14, 2009 0 comments
nvl2(exp1 exp2 exp3)
kyoichi83 answered on£ºJun 16, 2009 0 comments
nvl2 function is the upgraded form of nvl function.In nvl function we need to pass two parameters.i.e. nvl(interest_rate returned_value) if the value of interest_rate is null then the nvl function returns the value of second parameter 'returned_value'.In nvl2 function we need to pass three parameters .i.e. nvl2 (interest_rate returned_value_if_not_null returned_value_if_null)if the value of interest_rate is null then the nvl function returns the value of the third parameter 'returned_value_if_null' else it returns the value of the second parameter 'returned_value_if_not_null'.
feohna answered on£ºJun 18, 2009 0 comments