我有以下查询来查找佣金,如level1-20%,level2-10%,level 3 - 5%使用neo4j使用两个关系AFFILIATE_TO和PAID如下所示。
with [20.0, 10.0, 5.0] as percents
match (i:Instructor)-[r:AFFILIATE_TO*..3]->()-[:PAID]->(t:Payment)
with i, percents[size(r) - 1] as percent, t
with i, t.amount * percent / 100.0 as cut
return i.name as Name, sum(cut) as revenue
这里它返回每位教师的收入总和,是否可以计算此查询的个人收入。来自每个级别的收入?
答案 0 :(得分:3)
Cypher按您返回的所有密钥按-(void)refreshPermission {
if(!isExecuting){
isExecuting = YES;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Perform your tasks
isExecuting = NO;
}
}
}
汇总或分组。因此,如果您希望从每个级别获得RETURN
收入,您还需要RETURN
级别大小,或者至少在RETURN
语句中将其用于groupby。
WITH