1
複数のノードのカウントを取得する方法。サイファークエリで関係のない複数のノードの数を取得する
MATCH (n1:node1)
MATCH (n2:node2)
MATCH (n3:node3) where n3.status = "active"
return count(n1) as countOfNode1,
count(n2) as countOfNode2,
count(n3) as countOfNode3
実際のカウントがこれを行うにはどのように
countOfNode1 = 0
countOfNode2 = 3
countOfNode3 = 1
ここでこのクエリは
countOfNode1 = 0
countOfNode2 = 0
countOfNode3 = 0
として重複した結果を返していますか?
「distinct」を使用しても問題は解決しません。 として考える:私は考えている
return count(distinct n1) as countOfNode1,
count(distinct n2) as countOfNode2,
count(distinct n3) as countOfNode3
であるあなたは、ノードがどのrelationship'を持っていない '何を意味するのですか?どこのノード間のクエリの関係ですか? –
ノードn1とn2は関連していません – Jeevika
私の答えは機能しましたか? –