用TRansact-sql 实现 n!
时间:2022-03-14 04:10
declare @sum int,@count int
select @sum=0,@count=0
label_1:
select @count=@count+1
select @sum=@sum+@count
if @count<=6
goto label_1
select @count ‘数值‘,@sum ‘1~7累加和‘
运行结果:
时间:2022-03-14 04:10
declare @sum int,@count int
select @sum=0,@count=0
label_1:
select @count=@count+1
select @sum=@sum+@count
if @count<=6
goto label_1
select @count ‘数值‘,@sum ‘1~7累加和‘
运行结果: