Search notes:

SQLite: recursive query - generate fibonacci numbers

--
--  Inspired by http://stackoverflow.com/a/38821165/180275
--

with recursive fib (n1, n2) as (
     select
        1,
        1
   union all
     select
       n2,
       n1+n2
     from
       fib
     limit 50
)
select
  printf("%11d", n1)
--group_concat(n1)
from
  fib;
Github repository about-sqlite, path: /sql/with/fibonacci.sql

See also

Recursive queries

Index