帮忙写个SQL自定义函数

kmiaoer 2008-11-21 04:55:40
传入 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 =
...全文
183 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
kmiaoer 2008-11-21
  • 打赏
  • 举报
回复
自己搞定。。
kmiaoer 2008-11-21
  • 打赏
  • 举报
回复
up
kmiaoer 2008-11-21
  • 打赏
  • 举报
回复
再此上下文中不能使用带有返回值的return
草原可可 2008-11-21
  • 打赏
  • 举报
回复
报什么错误 错误代码
kmiaoer 2008-11-21
  • 打赏
  • 举报
回复
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

我写的这个老是出错。。请大哥看看

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧