我有一个Case When
工作正常的声明:
sum(CASE WHEN datepart(dw,applydtm) = '1'
then (cast(durationsecsqty as float)/3600)
else 0
End
) as Sunday
WHEN
但是当它到达时我需要添加另一个(cast(durationsecsqty as float)/3600)
。此时如果返回结果是0
我想从另一列中提取值,moneyamt
.
我正在尝试将此声明与我的第一个声明结合起来:
Case (CAST(durationsecsqty as float)/3600)
when 0
then moneyamt
else (CAST(durationsecsqty as float)/3600)
end as Sunday