recursive-cte cte-table-name AS ( initial-select UNION ALL recursive-select ) UNION References: cte-table-name See also: lang_with.html SQLite is in the Public Domain. https://sqlite.org/syntax/recursive-cte.html