You can translate the question and the replies:

Common Table Expression (CTE) and Recursion

I see there is support of WITH statements allowing CTE work. Does Denodo support recursion in CTE's? I have tried to get it working, but the error back is that the name of the CTE does not exist. When I remove the recursion piece of the query, it works. Recursion Example (from SQL Server web sites): WITH DirectReports (ManagerID, EmployeeID, Title, DeptID, Level) AS ( -- Anchor member definition SELECT e.ManagerID, e.EmployeeID, e.Title, edh.DepartmentID, 0 AS Level FROM dbo.MyEmployees AS e INNER JOIN HumanResources.EmployeeDepartmentHistory AS edh ON e.EmployeeID = edh.BusinessEntityID AND edh.EndDate IS NULL WHERE ManagerID IS NULL UNION ALL -- Recursive member definition SELECT e.ManagerID, e.EmployeeID, e.Title, edh.DepartmentID, Level + 1 FROM dbo.MyEmployees AS e INNER JOIN HumanResources.EmployeeDepartmentHistory AS edh ON e.EmployeeID = edh.BusinessEntityID AND edh.EndDate IS NULL INNER JOIN DirectReports AS d ON e.ManagerID = d.EmployeeID ) -- Statement that executes the CTE SELECT ManagerID, EmployeeID, Title, DeptID, Level FROM DirectReports INNER JOIN HumanResources.Department AS dp ON DirectReports.DeptID = dp.DepartmentID WHERE dp.GroupName = N'Sales and Marketing' OR Level = 0;
user
05-08-2015 15:27:32 -0400

3 Answers

Hi, Recursive queries are not supported now but they are in the Roadmap.
Denodo Team
06-08-2015 06:27:28 -0400
Is this still on the roadmap?
user
17-08-2021 15:00:29 -0400
Hi, Yes, I could confirm that the Recursive CTE is on the roadmap. You could refer to the similar community question answered **[here](https://community.denodo.com/answers/question/details?questionId=90670000000Cc1tAAC&title=Recursive%2FHierarchical+Query)**. Hope this helps!
Denodo Team
18-08-2021 04:59:45 -0400
You must sign in to add an answer. If you do not have an account, you can register here