alter function liejia ( @a int, @z int) returns int as begin declare @sum int while(@a<=@z) begin set @sum=isnull(@sum,0)+@a set @a=ISNULL(@a,0)+1 end return @sum end go select dbo.liejia(1,100)
alter function liejia ( @a int, @z int) returns int as begin declare @sum int while(@a<=@z) begin set @sum=isnull(@sum,0)+@a set @a=ISNULL(@a,0)+1 end return @sum end go select dbo.liejia(1,100)
转载于:https://www.cnblogs.com/hellowworld/p/10045272.html