select Sum(BF.FeeRate) from BudgetFees BF
LEFT JOIN ChargeSub cs ON BF.ChargeId = cs.ChargeCode
where cs.FeeRateUnit ='%'
and bf.Oversea = 1 and bf.Contractid =
...全文
1835打赏收藏
帮忙写个SQL自定义函数
传入 contractid 为int 类型,返回numeric类型 select Sum(BF.FeeRate) from BudgetFees BF LEFT JOIN ChargeSub cs ON BF.ChargeId = cs.ChargeCode where cs.FeeRateUnit ='%' and bf.Oversea = 1 and bf.Contractid =
CREATE FUNCTION Fee_No_BFB(@ContractID as int)
return numeric
as
begin
declare @i numeric
select @i=Sum(BF.FeeRate) from BudgetFees BF LEFT JOIN ChargeSub cs ON BF.ChargeId = cs.ChargeCode where cs.FeeRateUnit ='%' and bf.Oversea = 1 and bf.Contractid = @ContractID
return @i
end