如何在 Cypher 中实现等同于 SQL Having 子句的功能
在传统的基于 SQL 的数据库中,HAVING 子句用于限制聚合值。例如
select zipcode, count(*) as population
from Person
group by zipcode
having population>100000;
将返回居住人口超过 10 万的所有邮政编码。要在 Cypher 中实现相同的功能,请使用以下查询
match (n:Person)
with n.zipcode as zip, count(*) as population
where population > 100000
return zip, population
本页是否有帮助?