opencypher.org | opencypher@googlegroups.com opencypher.org | opencypher@googlegroups.com
● ● DO ● ● opencypher.org | opencypher@googlegroups.com
● UNION ● INTERSECT opencypher.org | opencypher@googlegroups.com
● EXCLUSIVE UNION ● EXCLUDE opencypher.org | opencypher@googlegroups.com
MATCH (a:Person)-[:LIVES_IN]->(:City {name: "Berlin"}) RETURN * INTERSECT MATCH (a:Person)-[:BORN_IN]->(:City {name: "London"}) RETURN * opencypher.org | opencypher@googlegroups.com
MATCH (a:Person)-[:LIVES_IN]->(:City {name: "Berlin"}) RETURN * INTERSECT { MATCH (a:Person)-[:BORN_IN]->(:City {name: "London"}) RETURN * UNION MATCH (a:Person)-[:BORN_IN]->(:City {name: "New York City"}) RETURN * } opencypher.org | opencypher@googlegroups.com
MATCH (a:Person)-[:BORN_IN]->(:City {name: "London"}) RETURN * UNION MATCH (a:Person)-[:BORN_IN]->(:City {name: "New York City"}) RETURN * INTERSECT MATCH (a:Person)-[:LIVES_IN]->(:City {name: "Berlin"}) RETURN * opencypher.org | opencypher@googlegroups.com
● UNION ALL ● INTERSECT ALL ● EXCLUDE ALL ● UNION MAX ● EXCLUSIVE UNION MAX opencypher.org | opencypher@googlegroups.com
● <q1> EXCEPT <q2> EXCEPT <q3> ... => <q1> EXCEPT (<q2> EXCEPT (<q3> EXCEPT ( ... ) ) ) ● RETURN NULL EXCEPT RETURN NULL => Empty Result opencypher.org | opencypher@googlegroups.com
● { ... } UNION { ... } { { ... } UNION { ... } EXCEPT ... } opencypher.org | opencypher@googlegroups.com
● THEN ● CROSS ● OTHERWISE opencypher.org | opencypher@googlegroups.com
● WITH ● ● ○ ○ MATCH ... RETURN * THEN MATCH ... RETURN * opencypher.org | opencypher@googlegroups.com
MATCH (city:City) RETURN city CROSS MATCH (continent:Continent) RETURN continent THEN RETURN city.name, continent.name, EXISTS { (city)-[:PARTNER]-(other:City)-[:IN]->(continent) } opencypher.org | opencypher@googlegroups.com
MATCH (p:Person)-[:LIVES_IN]->(c:City) RETURN * LIMIT 1 OTHERWISE MATCH (a:Person)-[:WORKS_IN]->(c:City) RETURN * LIMIT 1 THEN MATCH (c)-[:RECOMMEND]->(attraction:Attraction) RETURN p.name, attraction.name, attraction.price opencypher.org | opencypher@googlegroups.com
● ● ● opencypher.org | opencypher@googlegroups.com
Recommend
More recommend