RosettaCodeData/Task/Fibonacci-sequence/DuckDB/fibonacci-sequence-1.duckdb

12 lines
205 B
Plaintext

create or replace function fib_to(n) as table (
with recursive fib(e,f) as (
select 1, 1
union all
select e+f,e from fib
where e <= n)
select f from fib
order by f
);
from fib_to(55);