title: how to create relationship and merge/create new node in loop in neo4j
body: <p>I am trying to create friend relationship to all the ids in the list but I am getting an error:</p>
  
  <pre><code>y already declared (line 2, column 41 (offset: 64))
  
  "Merge (y:User{id:"21",name:"b"})
   Merge (y:User{id:"41",name:"d"})
   Merge (y:User{id:"51",name:"e"}) "
                                           ^
   Neo.ClientError.Statement.InvalidSyntax
  </code></pre>
  
  <p>I am trying to create a new user with id,name,year and also relationship with existing node at the same time .How can I do it ?Is there any other way also?I really appreciate any help.</p>
  
  <pre><code>MATCH (u:User {id:"2"})
  Merge (y:User{id:"21",name:"b",year:"2010"})
  Merge (y:User{id:"41",name:"d",year:"2011"})
  Merge (y:User{id:"51",name:"e",,year:"2013"}) 
  MERGE (u)-[:FRIEND]-&gt;(y)
  </code></pre>