`
tempsitegoogle
  • 浏览: 866761 次
文章分类
社区版块
存档分类
最新评论

oracle 除数不能为0

 
阅读更多

--建表

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


--查表(通过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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics