dbspace
dbspace

Reputation: 231

neo4j cypher how to get rid of duplicate in count

I want to find out how many times the actor are acting together, for example both Keanu and Carrie act in matrix, when I count it, it shows up two times, one for keanu, Carrie, the other is carrier, keanu. How do I get rid of 1 of them. I have create the example here http://console.neo4j.org/r/9p5798

Upvotes: 2

Views: 187

Answers (1)

Aravind Yarram
Aravind Yarram

Reputation: 80176

START a=node(*), b=node(*) 
MATCH a-[:ACTED_IN]->(m)<-[:ACTED_IN]-b 
WHERE id(a)< id(b) 
RETURN a, b, count(m)

Upvotes: 2

Related Questions