FOR STATEMENT

Description

Creates a loop that iterates over a range of integer values.

Click here to navigate to the PostgreSQL documentation page for this syntax.

For Statement is partially supported by Snowflake.

Grammar Syntax

[ <<label>> ]
FOR name IN [ REVERSE ] expression .. expression [ BY expression ] LOOP
    statements
END LOOP [ label ];

Sample Source Patterns

Input

The BY Expression is not supported in Snowflake.

FOR i IN REVERSE 10..1 BY 2 LOOP
    Select AValue from ATable;
END LOOP;

Known Issues

No issues were found.

Last updated