我运行以下查询来获取每个类别的平均喜欢
neo4j-sh (?)$ START n=node:node_auto_index(type = "U") match n-[r:likes]->()-[:mapsTo]->items return AVG(r.count) as AVGLIKES, items.name as CATEGORY;
==> +------------------------------------------------------+
==> | AVGLIKES | CATEGORY |
==> +------------------------------------------------------+
==> | 7.122950819672131 | "Culture" |
==> | 1.3333333333333333 | "Food & Drinks" |
==> | 2.111111111111111 | "Albums" |
==> | 2.581081081081081 | "Movies" |
==> | 2.1 | "Musicians" |
==> | 7.810126582278481 | "Culture Celebs" |
==> | 3.1206896551724137 | "TV Shows" |
==> | 1.0 | "Apps/Games" |
==> | 4.0256410256410255 | "Cars" |
但是 AVG 是一个内置函数,我如何计算每个类别的标准差和其他统计摘要。我正在寻找像SQL 中的“GROUP BY”这样的东西,它将为每个类别分组所有内容,然后我可以编写一些代码或者是否有更好的方法来做到这一点。