Skip to content

Possible to limit returned result after group by #4511

Answered by joruxs
joruxs asked this question in Q&A
Discussion options

You must be logged in to vote

I believe I found a solution.

In the open cypher documentation (https://s3.amazonaws.com/artifacts.opencypher.org/openCypher9.pdf) in the section about WITH there is an example called "Filter on aggregate function results":

Adapting their example to my problem above we can do this:

MATCH (p:Person)
WITH p.Person.drink as drink, count(*) as num_of_fans
WHERE num_of_fans > 1 AND num_of_fans < 3
RETURN drink, num_of_fans;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by joruxs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant