-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
questionQuestion?Question?
Description
Company or project name
No response
Question
Hi! I noticed a strange behavior of the WITH statement when using subqueries.
For some reason this doesn't work:
with
A = 2 as selector
select sum(value) from (
select * from test_table where selector
union all
select * from test_table
)While this DOES:
+select sum(value) from (
with
A = 2 as selector
-select sum(value) from (
select * from test_table where selector
union all
select * from test_table
)I really want to write it the first way because I want to access some stuff in the global scope and it is less convenient to nest the WITH statements in my opinion.
So is it a behavior I did not get? If so, is that explained somewhere in the docs?
Thanks in advance 😊
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionQuestion?Question?