2016-08-05 72 views

回答

2

我想我找到了一個解決方案,查詢需要正確鏈接。任何「更好的解決方案」高度讚賞。

MATCH (n1)-[r]-(n2) 
WITH distinct n1,n2, count(r) as sstcount 
MATCH (n1)-[r]-(n2) 
where sstcount>1 
return n1,r,n2 
0

試試這個來代替:

MATCH (n1)-[r]-(n2) 
WHERE id(n1) < id(n2) // so we avoid matching to the same nodes in swapped order 
WITH n1,n2, count(r) as sstcount 
WHERE sstcount > 1 
RETURN n1, n2 
相關問題