

The syntax of the for loop statement to iterate over a result set of a query: įirst, we create a sample table using the below commands to perform examples: CREATE TABLE employees ( The following code uses the for loop statement to iterate over ten numbers from 10 to 1 and display each of them in each iteration: do $$ The following code uses the for loop statement to iterate over ten numbers from 1 to 10 and display each of them in each iteration: do $$ The following flowchart describes the for loop statement:

This step expression is evaluated only once.
The syntax of the for loop statement to iterate over a range of integers: įor loop_cnt in from. For loop to iterate over a range of integers The different uses of the for loop in PostgreSQL are described below: 1. PostgreSQL provides the for loop statements to iterate over a range of integers or over a result set or over the result set of a dynamic query. ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
