Skip to content

Commit 6baa37f

Browse files
syntax is complicated
1 parent 9e6ec01 commit 6baa37f

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

modules/ROOT/pages/queries/composed-queries/conditional-queries.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CREATE
4141
WHEN predicate THEN [{]
4242
<conditionalQuery>
4343
[}]
44-
[WHEN ...]
44+
[WHEN ...]*
4545
[ELSE [{]
4646
<conditionalQuery>
4747
[}]]
@@ -260,11 +260,11 @@ xref:subqueries/existential.adoc[`EXISTS`], xref:subqueries/collect.adoc[`COLLEC
260260
[<outerExpression>]
261261
EXISTS|COUNT|COLLECT {
262262
WHEN predicate THEN [{]
263-
<conditionalQuery>
263+
<conditionalQuery>
264264
[}]
265265
[WHEN ...]*
266266
[ELSE [{]
267-
<conditionalQuery>
267+
<conditionalQuery>
268268
[}]]
269269
}
270270
[<outerExpression>]
@@ -273,12 +273,12 @@ EXISTS|COUNT|COLLECT {
273273

274274
.Conditional `EXISTS` subquery
275275
=====
276-
In this example, `WHEN` is used inside an xref:subqueries/existential.adoc[`EXISTS` subquery] to conditionally execute different branches based on the evaluation of the predicate (`n.age > 40`).
276+
In this example, `WHEN` is used inside an `EXISTS` subquery to conditionally execute different branches based on the evaluation of the predicate (`n.age > 40`).
277277
278278
[NOTE]
279-
Unlike `CALL` subqueries, variables returned in an `EXISTS` subquery are not available to the outer scope (the same is true for xref:subqueries/count.adoc[`COUNT`] and xref:subqueries/collect.adoc[`COLLECT` subqueries]).
279+
Unlike `CALL` subqueries, variables returned in an `EXISTS` subquery are not available to the outer scope (the same is true for `COUNT` and `COLLECT` subqueries).
280280
281-
.`WHEN` inside `EXISTS` subquery
281+
.`WHEN` inside an `EXISTS` subquery
282282
[source, cypher]
283283
----
284284
MATCH (n:Person)
@@ -300,7 +300,7 @@ RETURN n.name AS name,
300300
.Result
301301
[role="queryresult",options="header,footer",cols="2*<m"]
302302
|===
303-
| names | age
303+
| name | age
304304
305305
| "Alice" | 65
306306
| "Charlie" | 61
@@ -323,24 +323,24 @@ If the conditional query begins with `WHEN` and involves `UNION`, the `WHEN` bra
323323
----
324324
{
325325
WHEN predicate THEN [{]
326-
<conditionalQuery>
326+
<conditionalQuery>
327327
[}]
328-
[WHEN ...]*
329-
[ELSE [{]
330-
<conditionalQuery>
328+
[WHEN ...]*
329+
[ELSE [{]
330+
<conditionalQuery>
331331
[}]]
332332
}
333333
UNION [DISTINCT|ALL]
334334
{
335335
WHEN predicate THEN [{]
336-
<conditionalQuery>
336+
<conditionalQuery>
337337
[}]
338-
[WHEN ...]*
339-
[ELSE [{]
340-
<conditionalQuery>
338+
[WHEN ...]*
339+
[ELSE [{]
340+
<conditionalQuery>
341341
[}]]
342342
}
343-
UNION [DISTINCT|ALL]*
343+
[UNION [DISTINCT|ALL] ...]*
344344
----
345345

346346
.Combining conditional branches with `UNION` using `{}`

0 commit comments

Comments
 (0)