-345   THE FULLSELECT OF THE RECURSIVE COMMON TABLE EXPRESSION name MUST BE A UNION ALL AND MUST NOT INCLUDE AGGREGATE FUNCTIONS, GROUP BY CLAUSE, HAVING CLAUSE, OR AN EXPLICIT JOIN INCLUDING AN ON CLAUSE

Explanation

The common table expression name includes a reference to itself and therefore:
  • must be the union of two or more fullselects.
  • cannot have aggregate functions.
  • cannot include a GROUP BY clause.
  • cannot include a HAVING clause.
  • cannot include an ORDER BY clause.
  • cannot include an explicit join with an ON clause.

System action

The statement cannot be processed.

Programmer response

Change the common table expression by:
  • making it a union of two or more fullselects.
  • removing any aggregate functions, GROUP BY clause, HAVING clause, ORDER BY clause, or explicit JOIN including an ON clause.
  • removing the recursive reference.

SQLSTATE

42836