I want to get the id of a user who has the sum of order count we have passed in the query.
Example:
consider this the below data
urid oc
1 2
1 3
1 0
2 1
3 6
1 4
3 1
I want the following output
- When I pass total count as
9it should return urid1 - When I pass total count as
1it should return urid2 - When I pass total count as
7it should return urid3
I have tried with the following Cypher Query. It is not working as execpted.
MATCH (ur:UR { id: "arqz12a" })
WITH ur, SUM(ur.oc) as count
WHERE count = 9
WITH ur, count
RETURN count, ur.urid;