Search Postgresql Archives

Is "WITH RECURSIVE" limited to the first position of CTEs by design?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Team,
  This was strange.  I wanted to set up a CTE that would FEED my recursive query.
And also feed the results filtering...

These are the most trivial examples.  The second one results in a syntax error.  Which implies that:
1) There can only be one recursive CTE at the same level?
2) It must be the FIRST CTE?

Example:
WITH RECURSIVE CTE1 AS (select 2 UNION ALL SELECT 0),
CTE2 AS (select 1 UNION ALL SELECT 0) select 3 ;

-- This does not work:

WITH CTE1 AS (select 2 UNION ALL SELECT 0),
RECURSIVE CTE2 AS (select 1 UNION ALL SELECT 0)
SELECT 3;
--> ERROR:  syntax error at or near "CTE2"

Thanks in advance...

Kirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux