我正在使用 sql server,我们确实有一个 while 循环,我在存储过程中创建了它。我正在评估 redshift 并在 redshift amazon 中寻找等效项。以下是我想要做的,我如何在亚马逊红移中做到这一点:
Declare
@MaxId SmallInt,
@CurrId SmallInt
Set @CurrId = 0
Set @MaxId = 10
While @CurrId <= @MaxId
Select @CurrId
set @CurrId = @CurrId + 1
end
Run Code Online (Sandbox Code Playgroud)