Resolved Question
explaint the nvl2 function
 
Details:
  asked by: dominiquekay  on: Jun 9, 2009  
 Best Answer ! ! !
guardianx3 's Answer  ( this answer is maked as best answer of this question at: Jun 19, 2009 )


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.
1 comments  answered on: Jun 14, 2009 
Other Answer (6)

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)
if exp1 is null it manipulate exp3 if exp1 is not null it manipulates exp2
eg:select ename nvl2(comm comm sal sal) net from emp;
  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

Hot Questions

Contact Us - IT-Interview