3
此查询递归CTE产生从1号至4问题与PostgreSQL的
with recursive z(q) as (
select 1
union all
select q + 1 from z where q < 4
)
select * from z;
但是,如果我把它修改这个,
with x as (
select 1 y
),
recursive z(q) as (
select y from x
union all
select q + 1 from z where q < 4
)
select * from z;
它给
ERROR: syntax error at or near "z"
我在这里做错了什么?
后来相关的更多细节的答案: http://stackoverflow.com/a/35249370/939860 –