--建表
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
--建表
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