Neo4j aggregate function

前端 未结 1 1999
轮回少年
轮回少年 2021-01-24 11:32

I am trying to use the SUM function and store the result of it as a new property of the relationship. But it is not working. The query I used is :

         


        
1条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 12:06

    Try it:

    MATCH (a:Employee)-[r:CorporateMessage]->(b)
    WHERE a.Eid = 6001 AND b.Eid IN [6002,6003,6004,6005,5001]
    WITH r, SUM(r.count) as count
    SET r.Internalsum = count
    

    Always put aggregation functions in WITH or RETURN.

    0 讨论(0)
提交回复
热议问题