Skip to main content

Recursive CTE

Learn Recursive CTE (Common Table Expressions, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Introduction A recursive CTE references itself. It has an anchor member (the starting rows) combined by UNION ALL with a recursive member that joins the previous iteration's rows; evaluation repeats until the recursive part returns no new rows. Syntax: WITH RECURSIVE .

More lessons in Common Table Expressions