7

How I can write a query like that:

with t1 as 
(
select id 
from table1
),
RECURSIVE t2(
select * from t2
union
...
)

Currently it's not allowed?

1 Answer 1

12

The recursive needs to be right after the WITH regardless on where you put the recursive CTE:

with recursive t1 as 
(
  select id 
  from table1
), t2 (
  select *  
  from t2
  union
  ...
)
...
1
  • thanks a lot!! I would never have thought that such a syntax Commented Dec 26, 2017 at 15:41

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.