Neo4j 简明教程

Neo4j - Aggregation Function

与 SQL 类似,Neo4j CQL 在 RETURN 子句中提供了一些聚合函数供使用。它类似于 SQL 中的 GROUP BY 子句。

Like SQL, Neo4j CQL has provided some aggregation functions to use in RETURN clause. It is similar to GROUP BY clause in SQL.

我们可以在 MATCH 命令中使用这些 RETURN + 聚合函数对一组节点执行操作并返回一些聚合值。

We can use this RETURN + Aggregation Functions in MATCH command to work on a group of nodes and return some aggregated value.

AGGREGATION Functions List

以下列出 Neo4j 中的聚合函数:

Following is the list of aggregation functions in Neo4j.

Sr.No

Function & Description

1

COUNTIt returns the number of rows returned by MATCH command.

2

MAXIt returns the maximum value from a set of rows returned by MATCH command.

3

MINIt returns the minimum value from a set of rows returned by MATCH command.

4

SUMIt returns the summation value of all rows returned by MATCH command.

5

AVGIt returns the average value of all rows returned by MATCH command.