ITPub博客

首页 > 数据库 > Oracle > ORA-01476的异常

ORA-01476的异常

原创 Oracle 作者:oraclle 时间:2009-10-30 17:11:31 0 删除 编辑

主要就是在ORACLE中进行除的时候出现了除数为0.所以应该做的就是。避免出现这样的情况。就使用函数。

decode(t.person_no,0,null,a.count_uid /t.person_no ) 可以避免

select round (decode(t.person_no,0,null,a.count_uid /t.person_no ),2), t.unit_id
from (select count(tg.unit_id) count_uid, tg.unit_id
from t_group_info tg, t_alarm_allmember ta
where tg.unit_id = ta.unit_code
and tg.be_policy_type = 'AB'
group by tg.unit_id) a,
t_group_info t
where t.be_policy_type = 'AB'
and a.unit_id= t.unit_id

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22787229/viewspace-1028322/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Oracle递归查询
请登录后发表评论 登录
全部评论
  • 博文量
    9
  • 访问量
    10627