with FIBONACCI (i, SPIRAL, PREV) as
(
select
1 i, 0 SPIRAL, cast(null as number) PREV
from
DUAL
union all
select
f1.i + 1 i, f1.SPIRAL + nvl(f1.PREV,1) SPIRAL, f1.SPIRAL PREV
from
FIBONACCI f1
where
f1.i < 605
)
select SPIRAL from FIBONACCI order by i;
The limit of 605 is the limit before numeric overflow.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here it is in Oracle SQL:
The limit of 605 is the limit before numeric overflow.