Skip to content

Instantly share code, notes, and snippets.

@malisper
Created June 11, 2017 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malisper/8d955a0a2bba94027b9ffc5e8457f854 to your computer and use it in GitHub Desktop.
Save malisper/8d955a0a2bba94027b9ffc5e8457f854 to your computer and use it in GitHub Desktop.
def base_query():
return [1]
def recursive_query(ints):
return [n+1 for n in ints if n+1 <= 100]
def recursive_cte()
results = []
working_table = base_query()
while len(working_table) != 0:
results += working_table
working_table = recursive_query(working_table)
return results
recursive_cte()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment