在Postgres sql中,是否可以连续使用WITH语句? e.g。
WITH t1 AS (
...some select statement
)
WITH t2 AS (
...select from t1
)
SELECT * FROM t2;
我已经尝试了上述内容但确实有效;似乎正在发挥作用?
答案 0 :(得分:3)
使用:
WITH t1 AS (
...some select statement
),
t2 AS (
...select from t1
)
SELECT FROM t2;