Subject RE: [firebird-support] Number list without table
Author Leyne, Sean
Piotr

> I need to get list of number (f.e 1,2,3,4,5) as rows but using only SQL query
> (without extra table or view).
>
> Something what after running query looks like:
>
> List_of_numbers
>
> -----------------------
>
> 1
> 2
> 3
> 4
> 5
>
> Any ideas??
>

EXECUTE BLOCK (
StartNumber Integer,
EndNumber Integer
) RETURNS (
List_of_Numbers Integer
) AS
BEGIN

List_of_Numbers = StartNumber;
WHILE (List_Of_Numbers <= EndNumber) DO BEGIN
Suspend;
List_Of_Numbers = List_Of_Numbers + 1;
END

END