Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-08-2021 02:05 AM
Hello, I have this query
match (c1:CI)-[:USES]->(c2:CI)
return distinct c1.name,c2.name
Now I would like to count the rows, but I don't seem to be able to figure this out!
I tried
return count(*)
but this does count duplicates.
I tried
return count (distinct c1.name)
but this is wrong, as it counts only the "users", not the distinct relationships.
Other attempts gave me error.
Could you help?
Tnx!
Solved! Go to Solution.
01-08-2021 03:02 AM
Hello @dario.piantanida and welcome to the Neo4j community
MATCH (c1:CI)-[:USES]->(c2:CI)
WITH DISTINCT c1.name AS c1_name, c2.name AS c2_name
RETURN count(c1_name) AS couples
Regards,
Cobra
01-08-2021 03:02 AM
Hello @dario.piantanida and welcome to the Neo4j community
MATCH (c1:CI)-[:USES]->(c2:CI)
WITH DISTINCT c1.name AS c1_name, c2.name AS c2_name
RETURN count(c1_name) AS couples
Regards,
Cobra
All the sessions of the conference are now available online