2009/04/19

Nvl2

nvl2(p1,p2,p3) 

表示如下 
if p1 is null then 
  return p3
else 
  return p2 
end if

例 : Nvl2(null,'A','B') 
結果 : B

例 : Nvl2('Test','A','B') 
結果 : A

結論 : 表示式同decode(p1,null,p3,p2)  
兩者間我倒覺得Decode比較看得清楚明白些

沒有留言: