我已经在解决方案上工作,我需要一些干预来优化解决方案。
以下是我当前的脚本:
create function SI (@Principal int, @roi int , @time int)
returns int
as
begin
declare @Principal_Amt int
--set @Principal_Amt = 10000
set @Principal_Amt = @Principal
declare @rate int
--set @rate=10
set @rate = @roi
declare @time_period int
--set @time_period = 5
set @time_period = @time
declare @Simple_Interest int
set @Simple_Interest = @Principal_Amt * @rate * @time_period / 100
return @Simple_Interest
end
select dbo.SI(10000, 8, 5)发布于 2019-05-06 19:34:43
这只是
create function SI(@Principal int = 0, @roi int = 0, @time int = 0)
returns int
as
begin
return (@Principal * @roi * @time /100)
end您不需要声明这些变量,因为您已经有了它们,所以可以直接使用它们。
https://stackoverflow.com/questions/56004327
复制相似问题