Reputation: 1436
In Postgres sql, is it possible to have consecutive WITH statements? e.g.
WITH t1 AS (
...some select statement
)
WITH t2 AS (
...select from t1
)
SELECT * FROM t2;
I have tried the above and it does;t seem to be working?
Upvotes: 0
Views: 649
Reputation: 121834
Use:
WITH t1 AS (
...some select statement
),
t2 AS (
...select from t1
)
SELECT FROM t2;
Upvotes: 3