I am using sql server and we do have a while loop there which I have created in a Stored procedure.. I am evaluating redshift and looking for a equivalent in redshift amazon. Below is what I am trying to do, how do I do this in amazon redshift:
Declare
@MaxId SmallInt,
@CurrId SmallInt
Set @CurrId = 0
Set @MaxId = 10
While @CurrId <= @MaxId
Select @CurrId
set @CurrId = @CurrId + 1
end