dd:= (cc+ bb)/aa;    
sum(decode(aa,'1',1,0))/count(1),4)

解决方案 »

  1.   

    既然你是用存储过程写的  直接IF ELSE判断一下不就OK了么   
    还有 sum(decode(aa,'1',1,0))/count(1),4)  这是啥东西  我真心没看懂.....
      

  2.   

    sum(decode(aa,'1',1,0))/count(1),4)
    ->
    sum(decode(count(1),0,0,decode(aa,'1',1,0))/count(1)),4)
      

  3.   

    decode(分母,null,0,0,0,分子/分母) ratio
      

  4.   

    if aa = 0
       dd := 0%
    else 
       dd := (cc+ bb)/aa;