First of all, basic SQL alone does not have a grammar similar to a FOR statement.
However, each DBMS vendor supports a function, procedure, that can be used by prescribing a set of commands. The DBMS vendor may provide this procedure when you create it.
Study the procedure part of MSSQL.
Simple example sentence has an example of While Loop.
It's called cursor.
© 2024 OneMinuteCode. All rights reserved.