Skip to content

Instantly share code, notes, and snippets.

@BRonen
Created April 26, 2024 00:27
Show Gist options
  • Save BRonen/1b222f5b17e45f559c99b5b7a11e1349 to your computer and use it in GitHub Desktop.
Save BRonen/1b222f5b17e45f559c99b5b7a11e1349 to your computer and use it in GitHub Desktop.
fibonnaci with sql recursive queries
with recursive fib as (
select 0 as a, 1 as b
union
select b, a + b from fib
) select a from fib limit 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment