-341 A CYCLIC REFERENCE EXISTS BETWEEN THE COMMON TABLE EXPRESSIONS name1 AND name2
Explanation
The common table expression name1 refers to name2 in a FROM clause within its fullselect and name2 refers to name1 in a FROM clause within its fullselects. Such forms of cyclic references are not allowed.
System action
The statement cannot be processed.
Programmer response
Remove the cyclic reference from one of the common table expressions.
SQLSTATE
42835