UNION operator can be used to combine the results from two separate queries. This operator is very useful to combine the results of two altogether different queries, which have no common match pattern among them. In this recipe, we will learn the use of the
UNION operator via examples.
To work through this recipe, you will need to create the nodes and relationships for which data has been provided with the code files.
We have divided this recipe into the following problem sets:
MATCH (n:Airport) RETURN n.name AS name UNION ALL MATCH (n:Flight) RETURN n.flight_number AS name
The following ...