Neo4j COUNT()函数

在Neo4j数据库中, COUNT()函数用于计算行数。

句法:

MATCH (n { name: 'A' })-->(x) 
RETURN n, count(*)

例:

使用以下查询来演示COUNT()函数的用法。当印度获胜时, 它将计算数字。

Match(n{name: "India", result: "Winners"})--(x)  
RETURN n, count(*)

输出

Neo4j计数函数1

组数

你也可以使用COUNT()函数计算关系类型的组。

例:

以下查询计算并返回参与每个关系的节点数。

Match(n{name: "India", result: "Winners"})-[r]-(x)  
RETURN type (r), count(*)
Neo4j计数函数2
微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_47539.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?