Oracle 除数不能为0

2014-11-24 18:59:46 · 作者: · 浏览: 24

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