UNION

Combine results from two queries into a single result set.

Syntax#

query1 UNION query2

Example#

MATCH (n:Person) RETURN n.name AS name
UNION
MATCH (n:Organization) RETURN n.name AS name

Returns all person and organization names in a single column.

See Also#

  • WITH — query chaining (within one query)
Try it
Open ↗
Loading engine…