I have a query to retrieve all the modules and child modules for a page, using a common table expression. Is it possible to use the results from the cte more than once?
You will need split child_modules CTE into two CTE's.
The first one containing the first SELECT of the current child_modules CTE, then use a second CTE that builds upon child_modules.
Your final SELECT would then use the third CTE instead of child_modules.