SQL CTE (WITH)
Common Table Expressions — WITH, recursive CTE, multiple CTEs. This category documents 25 SQL cte (with) entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example tested against MySQL, PostgreSQL, SQL Server, and SQLite. The entries are: WITH (CTE), Recursive CTE, Multiple CTEs, CTE in INSERT, CTE in UPDATE / DELETE, Recursive CTE - Number/Date Generation, Recursive CTE - Tree Path, SEARCH / CYCLE Clause (CTE), Gap Detection (Date Series), CTE with INSERT ... RETURNING (PG), CTE DELETE with RETURNING, CTE Performance (Materialize), Recursive CTE - Path Enumeration, Recursive CTE - Graph Traversal, Recursive CTE - Fibonacci Series, CTE with Multiple References, CTE with Subquery vs Temp Table, CTE Materialization Hints (PG), CTE with UNION ALL, Recursive CTE - Factorial, Multiple CTEs with Dependency, COMMON TABLE EXPRESSION (Recursive Tree), Recursive CTE - Date Series, CTE with OFFSET Pagination, CTE with Data Generation. Not sure where to start? WITH (CTE) and Recursive CTE are the most commonly used entries in this category. You can also search across every category from the search page, browse the complete A–Z index, or try any of these statements live in the SQL playground.