Chinaunix首页 | 论坛 | 博客
  • 博客访问: 814345
  • 博文数量: 101
  • 博客积分: 1311
  • 博客等级: 中尉
  • 技术积分: 1191
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-25 12:15
文章分类

全部博文(101)

文章存档

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;

阅读(19227) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~