0

ユーザー数が平均ユーザー数よりも多いグループを見つけたい場合は、where 句を追加しましたが、where で集計を使用することはできません.... これが私のサイファー クエリです。

params.put("query", "name:*");
ExecutionResult result = engine.execute( "start n=node:groups({query}) 
match n<-[:Members_In]-x 
with n,count(distinct x) as numberOfUsers
where numOfUsers>avg(numOfUsers) 
return  n.name,numOfUsers ", params );

nはグループ名、x は各グループのユーザーです。グループユーザーの平均数を取得してから、より多くのユーザーを含むグループを返すにはどうすればよいですか? ありがとう。

4

1 に答える 1

0

のように、WITH を使用してみてください

start n=node(*) 
match n<-[:Members_In]-x 
with n, count(distinct x) as countOfUsers
with n, avg(countOfUsers) as avg 
where avg<3 
return  n.name, avg

http://tinyurl.com/czkpmwsの例

于 2012-12-06T10:01:30.443 に答える