Oracle 除数不能为0


--Oracle建表

create table mytable(a int,b int,c int, d int)


--Oracle查表(通过case when)
select * from mytable

select a,b,c,d
        ,case when b=0 then
                   0
        else
               (t.a-t.b)/t.b
        end case
 from mytable t

更多Oracle相关信息见Oracle 专题页面 http://www.bkjia.com/topicnews.aspx?tid=12

相关内容