Instruction
Excellent! Okay, it's time to wrap things up.
- A recursive CTE is a CTE that refers to itself.
- The general syntax is:
WITH CteName AS ( SELECT ... -- anchor member UNION ALL SELECT ... FROM CteName ... -- recursive member WHERE .... -- termination check ) SELECT (DISTINCT) ... FROM CteName ... -- invocation - The anchor member is the starting point for our recursion.
- The recursive member must query the same CTE.
- The termination check is used to stop the recursion at some point.
- The invocation is used to actually show any results.
Okay, are you ready for a short quiz?
Exercise
Click to continue.



