@@ -109,6 +109,7 @@ RETURN customer.firstName AS chocolateCustomer
109109
110110
111111.Passing multiple variables to another query via `NEXT`
112+ // tag::sequential_queries_basic_example[]
112113[source, cypher]
113114----
114115MATCH (c:Customer)-[:BUYS]->(p:Product {name: 'Chocolate'})
119120RETURN customer.firstName AS chocolateCustomer,
120121 product.price * (1 - customer.discount) AS chocolatePrice
121122----
123+ // end::sequential_queries_basic_example[]
122124
123125.Result
124126[role="queryresult",options="header,footer",cols="2*<m"]
@@ -162,6 +164,8 @@ RETURN p.name as product, customers
162164======
163165[.include-with-NEXT]
164166======
167+
168+ // tag::sequential_queries_call[]
165169[source, cypher]
166170----
167171MATCH (p:Product)
176180
177181RETURN p.name as product, customers
178182----
183+ // end::sequential_queries_call[]
179184======
180185====
181186
@@ -204,6 +209,7 @@ It also avoids the parentheses and indentation of the `CALL` subquery.
204209== Interactions with conditional queries
205210
206211.Conditional queries in `NEXT`
212+ // tag::sequential_queries_chaining_conditional_queries[]
207213[source, cypher]
208214----
209215MATCH (c:Customer)-[:BUYS]->(:Product)<-[:SUPPLIES]-(s:Supplier)
@@ -227,6 +233,7 @@ WHEN size(personalities) > 1 THEN
227233ELSE
228234 RETURN customer, personalities[0] AS personality
229235----
236+ // end::sequential_queries_chaining_conditional_queries[]
230237
231238.Result
232239[role="queryresult",options="header,footer",cols="2*<m"]
@@ -255,6 +262,7 @@ Finally, the fourth segment is another conditional query which subsumes multiple
255262If a conditional query has a `NEXT` in any of its `THEN` or `ELSE` blocks, it is necessary to wrap the part after `THEN` or `ELSE` with `{}`.
256263
257264.`NEXT` inside a conditional query
265+ // tag::sequential_queries_in_conditional_queries[]
258266[source, cypher]
259267----
260268MATCH (c:Customer)-[:BUYS]->(p:Product)
@@ -273,6 +281,7 @@ ELSE {
273281 RETURN customer.firstName AS customer, "club below 1000" AS customerType, finalSum AS sum
274282}
275283----
284+ // end::sequential_queries_in_conditional_queries[]
276285
277286.Result
278287[role="queryresult",options="header,footer",cols="3*<m"]
0 commit comments