cypher query result using DISTINCT clause

10 views
Skip to first unread message

Marwa Elabri

unread,
Nov 18, 2016, 4:01:39 AM11/18/16
to Neo4j
Hi
I want to execute this query :
MATCH (N0:user) 
OPTIONAL MATCH (N0:user)-[R0:rating]->()
WITH distinct N0,R0, N0.age as AN0,  count(R0.likes) as AR0
order by ID(N0), AN0, AR0 desc 
WITH   N0.age as O1,  head(collect(R0.likes)) as O2, N0
RETURN  O1, O2, count(ID(N0)) 
ORDER BY  O1, O2

But I don't know why if I change the order of variables (N0,R0,..) after the clause DISTINCT this change the result of the query 

have you any axplanation for this please I need this urgently 
Reply all
Reply to author
Forward
0 new messages