Sql server中使用循环

来源:互联网 发布:淘宝爆款 编辑:程序博客网 时间:2024/05/22 16:00

 

declare @i int
select @i=1
while @i<10
begin
    print @i
    select @i=@i+1
end

 

 

 

输出的结果:

1
2
3
4
5
6
7
8
9

原创粉丝点击