Is there a way that i compare results from different queries? Could the following queries be written in a single query together with the return for the wanted result?
Query1: Returns countries and SUM from all points given by countries that are not part of their region.
MATCH (c:Country)
with c
MATCH (c)-[vFrom:vote_from]->(vP:vote_points)-[vFor:vote_for]->(c2:Country)
with c,c2,vP
where not c.region=c2.region
return c2.name,sum(toInteger(vP.points))
Example return from Query1:
"Monaco" 11
"Montenegro" 34
"France" 359
"Cyprus" 600
"Romania" 837
Query2: Returns countries and SUM from all points given by countries that are part of their region.
MATCH (c:Country)
with c
MATCH (c)-[vFrom:vote_from]->(vP:vote_points)-[vFor:vote_for]->(c2:Country)
with c,c2,vP
where c.region=c2.region
return c2.name,c.name,sum(toInteger(vP.points))
Example return from Query2:
"Monaco" 35
"Montenegro" 66
"France" 157
"Cyprus" 102
"Romania" 255
Wanted result:
"Monaco" 35
"Montenegro" 66