title: NEO4j Cypher query returning distinct value
body: <p>hello guys I am new to cypher query and I want to restrict duplicate values in my result </p>
  
  <p>the query is</p>
  
  <pre><code>match (ee:Personal {id:"id"})-[:Friend]-&gt;(fr),
   (fr)-[:Friend]-&gt;(fr2),
   (fr2)-[:Friend]-&gt;(friend:Personal),
   (friend)-[:Works]-&gt;(comp:Company) 
  
  where comp.name=~".*name.*" 
  and not friend.id="id" 
  and not (friend)-[:Friend]-(fr) 
  and not (friend)-[:Friend]-(ee) 
  and not (fr2)-[:Friend]-(ee) 
  
  optional match (comp)-[:Position]-&gt;(pos), 
   (friend)-[:Position]-&gt;(pos)  
  optional match (friend)-[:Location]-&gt;(loc) 
  
  return distinct  friend.name,  comp.name
  </code></pre>
  
  <p>but i get duplicate values as there are multiple node properties in return statemnt. If I return only one property then its fine. but i want distinct friends</p>