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
  ...
)
...
Sign up to request clarification or add additional context in comments.

1 Comment

thanks a lot!! I would never have thought that such a syntax

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.