cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How do I achieve the equivalent of a SQL Having clause with Cypher

With a traditional SQL based database a HAVING clause will restrict aggregated values. For example

select zipcode, count(*) as population 
from Person 
group by zipcode
having population>100000;

will return all zipcodes which have more than 100k residents.
To achieve the same in Cypher use the following

match (n:Person) 
with n.zipcode as zip, count(*) as population 
where population>100000
return zip,population
0 REPLIES 0