Reuse a Named Result Repeatedly
A CTE names an intermediate result used within one SQL statement. Write its name and query after WITH, then reference it from the following SELECT. A recursive CTE uses WITH RECURSIVE to select base rows, then adds new rows by using those found in the previous step.
GOAL
Explain how regular and recursive CTEs are processed.
Which categories are selected first by this recursive CTE?