5

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 Answers1

8

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
  ...
)
...