Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
** xref:queries/composed-queries/index.adoc[]
*** xref:queries/composed-queries/combined-queries.adoc[]
*** xref:queries/composed-queries/conditional-queries.adoc[]
*** xref:queries/composed-queries/sequential-queries.adoc[]

* xref:clauses/index.adoc[]
** xref:clauses/clause-composition.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ These codes order the features in the table below.
| G020
| Counted shortest group search
| xref:patterns/shortest-paths.adoc#shortest-groups[`SHORTEST GROUPS`]
|
|


| G035
| Quantified paths
Expand Down Expand Up @@ -188,6 +189,11 @@ For example, GQL’s graph reference values `CURRENT_GRAPH` and `CURRENT_PROPERT
| xref:clauses/limit.adoc[`LIMIT`], xref:clauses/order-by.adoc[`ORDER BY`]
| Cypher requires using the xref:clauses/with.adoc[`WITH`] clause, which GQL does not.

| GQ20
| Advanced linear composition with NEXT
| xref:queries/composed-queries/sequential-queries.adoc[]
| The GQL standard includes a `YIELD` clause for its `NEXT` statement which Cypher does not implement.

| GV39
| Temporal types: date, local datetime, and local time support
| xref:values-and-types/temporal.adoc[Temporal types], xref:functions/temporal/index.adoc#functions-date[`date()`]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ a|
label:functionality[]
label:new[]

[source, cypher, role="noheader"]
----
RETURN 1 AS a

NEXT

RETURN 1 AS b
----

| New `NEXT` keyword used for linear composition of queries.
For more information, see xref:queries/composed-queries/sequential-queries.adoc[].

a|
label:functionality[]
label:new[]

[source, cypher, role="noheader"]
----
MATCH (s:Supplier)-[:SUPPLIES]->(p:Product)
Expand Down
9 changes: 6 additions & 3 deletions modules/ROOT/pages/queries/composed-queries/index.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
= Composed queries
:description: Overview about how to use `UNION` and `WHEN` to construct combined or conditional queries in Cypher.

`UNION` and `WHEN` enable the composition of multiple separate query branches within a single query.
`UNION` allows for combining the results of different queries, while `WHEN` enables conditional queries, where different query branches can be made to execute depending on a set of criteria.
As such, `UNION` and `WHEN` manage in different ways the execution flow and logic of queries and cannot be used in queries as regular clauses.
`UNION`, `WHEN` and `NEXT` enable the composition of multiple separate query branches within a single query.
`UNION` allows for combining the results of different queries.
`WHEN` enables conditional queries, where different query branches can be made to execute depending on a set of criteria.
Finally, `NEXT` allows for the linear composition of sequential queries, passing the return values from one query to the next.
As such, `UNION`, `WHEN`, and `NEXT` manage in different ways the execution flow and logic of queries and cannot be used in queries as regular clauses.

For more information, see:

* xref:queries/composed-queries/combined-queries.adoc[]
* xref:queries/composed-queries/conditional-queries.adoc[] label:new[Introduced in Neo4j 2025.06]
* xref:queries/composed-queries/sequential-queries.adoc[] label:new[Introduced in Neo4j 2025.06]
Loading