declare @a int set @a = 0 while @a <= 10 begin print @a set @a = @a + 1 end sql沒有for循環,但是while也是一樣可以實現該功能的 转载于:https://www.cnblogs.com/Nina-piaoye/archive/2007/04/06/702228.html