【问题标题】:use aggregate functions in the WHERE clause (Neo4j)在 WHERE 子句中使用聚合函数 (Neo4j)
【发布时间】:2013-05-01 07:36:40
【问题描述】:

如何选择通过多个路径连接到 node(2) [from] 的所有节点?

START from=node(2)
MATCH p=from-->to
where count(p) > 1 
return from,to

致 Neo4J 团队:有实现 Count/Having 功能的计划吗? 到目前为止,该产品做得很好!

【问题讨论】:

  • 您应该在下面发布您的答案,然后接受它,这样这个问题就不会出现在未回答的列表中。谢谢。
  • @ean5533,感谢您的提示。

标签: graph neo4j cypher


【解决方案1】:

实际上找到了结合'WITH'关键字的解决方案

START from=node(*) 
MATCH p=from-->to 
WITH from as from , to as to, count(p) as paths 
WHERE paths >1 
RETURN to,paths

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-17
    相关资源
    最近更新 更多