You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* xref:clauses/with.adoc#linear-query-composition[Enable linear composition of multiple queries]
16
15
17
16
[[example-graph]]
18
17
== Example graph
@@ -164,6 +163,36 @@ RETURN s.name AS company,
164
163
3+d|Rows: 5
165
164
|===
166
165
166
+
`WITH` cannot de-scope variables imported to a xref:subqueries/call-subquery.adoc[`CALL` subquery], because variables imported to a subquery are considered global to its inner scope.
167
+
More specifically, a variable imported into a `CALL` subquery will be available to subsequent clauses even if a preceding `WITH` clause does not reference it.
168
+
169
+
In the below example, the `x` variable is imported to the inside scope of a `CALL` subquery, and is successfully referenced by the `RETURN` clause even though the preceding `WITH` neglects to list it.
170
+
171
+
.Variables cannot be de-scoped in the inner scope of a subquery
For more information, see xref:subqueries/call-subquery.adoc#import-variables[`CALL` subqueries -> Import variables].
195
+
167
196
[[bind-values-to-variables]]
168
197
== Bind values to variables
169
198
@@ -303,7 +332,7 @@ ORDER BY discountRates
303
332
== Explicitly project values
304
333
305
334
`WITH ALL` can be used to explicitly project all values bound to a variable.
306
-
This functionality was introduced as part of Cypher's xref:appendix/gql-conformance/index.adoc[], and using it is functionally the same as using simple `WITH`.
335
+
Using it is functionally the same as using simple `WITH`.
307
336
308
337
.Explicit result projection using `WITH ALL`
309
338
[source, cypher]
@@ -504,8 +533,3 @@ RETURN s.name AS supplier,
504
533
[NOTE]
505
534
The `FILTER` clause can be used as a more concise alternative to `WITH * WHERE <predicate>` constructs.
506
535
For more information, see xref:clauses/filter.adoc#filter-with-where[`FILTER` as a substitute for `WITH * WHERE`].
0 commit comments