case when then end
select
sum(case when lcc.iCurrencyID=1 then lcc.iNumber*fUnitprice
else lcc.iNumber*lcc.fUnitprice*lcc.fExchangeRate end)
,0) as a
from lccomeslist as lcc where istatus=1
and lcc.iLCContractID in
(
select cml.iLCContractID from CmLCContract as cml
where cml.istatus=1 and cml.iLoanCustomerID = 1
)
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 陈大雷的 Blog