想实现如下的功能,但是调试总出错
select D,R,ZD,
case(
when R/D>=1 and R/D<=1.5 then 0.1*D
when R/D>1.5 and R/D<2.88 then (0.198-0.04*R/D)*D/1.38
when R/D<=2.88 then 0.06*D end
)as t from ZDXWGJ
求帮助!
------解决方案--------------------------------------------------------
试试
select D,R,ZD,
case
when R/D>=1 and R/D<=1.5 then 0.1*D
when R/D>1.5 and R/D<2.88 then (0.198-0.04*R/D)*D/1.38
when R/D<=2.88 then 0.06*D end as t from ZDXWGJ
------解决方案--------------------------------------------------------
select D,R,ZD,
(case
when R/D>=1 and R/D<=1.5 then 0.1*D
when R/D>1.5 and R/D<2.88 then (0.198-0.04*R/D)*D/1.38
when R/D<=2.88 then 0.06*D end
)as t from ZDXWGJ