这是我的问题的一个示例:
有一些节点和关系
那么我如何获得这样的表:
答案 0 :(得分:0)
我认为这样的事情应该可以帮助您。
// find all the sale occurences
MATCH (staff:Staff)-[sale:SELL]-(toy:Toy)
// count the sales per staff and toy ordered by toy
WITH staff.name AS staff, toy.name AS toy, count(sale) AS sales
ORDER BY toy
// aggregate the toys and counts per staff member
RETURN staff, collect(toy) AS toys, collect(sales) AS total_sales