「T-SQL」contiuneでループの先頭に戻るサンプル
書式
BEGIN
条件式
CONTINUE
END
使用例
CREATE PROCEDURE dbo.SAMPLE AS DECLARE @tt INT SET @tt = 1 WHILE @tt < 6 BEGIN IF @tt = 2 BEGIN SET @tt = @tt + 1 CONTINUE END PRINT @tt SET @tt = @tt + 1 END
実行結果
1 3 4 5
Coding Changes the World
書式
BEGIN
条件式
CONTINUE
END
使用例
CREATE PROCEDURE dbo.SAMPLE AS DECLARE @tt INT SET @tt = 1 WHILE @tt < 6 BEGIN IF @tt = 2 BEGIN SET @tt = @tt + 1 CONTINUE END PRINT @tt SET @tt = @tt + 1 END
実行結果
1 3 4 5