Fixed query using further CTE and Recursion.