您的位置:首页 > 博客中心 > 数据库 >

用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累加和‘

 

 

运行结果:技术分享

热门排行

今日推荐

热门手游