2012年(101)
分类: Oracle
2012-06-12 16:12:54
ORA-01476: divisor is equal to zero解决方法
ORA-01476: 除数为0 解决方法
使用decode函数做一下替换,如果为0,则替换为1
select eh/(decode(fh,0,1))*100 ||'%' "百分比" from (select '1' l,count(b.hrid) eh from t_psr_hrid
a,t_dc_newborn_faml_visi b,t_psr_dossierinfo c where (a.hrid=b.hrid) and (a.hrid=c.hrid and c.areacode = '410300')) e ,(select '1' l,count(b.hrid) fh from t_psr_hrid a,t_dc_newborn_faml_visi b,t_psr_dossierinfo c where
(a.hrid=b.hrid and a.hrid=c.hrid)) f where e.l=f.l;