# Merge: Bounding Relationships

**URL:** <https://community.neo4j.com/t/merge-bounding-relationships/9515>\
**Category:** Cypher\
**Created:** [August 19, 2019, 10:39am UTC](https://community.neo4j.com/t/merge-bounding-relationships/9515 "2019-08-19T10:39:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayantest2](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shayantest2/32/5901_2.png) [@shayantest2](https://community.neo4j.com/u/shayantest2)\
**Post date:** [August 19, 2019, 10:39am UTC](https://community.neo4j.com/t/merge-bounding-relationships/9515/1 "2019-08-19T10:39:04Z")

</div>

How should I bound relationships in merge? For example, the following query works fine.

```auto
MERGE (dummy{name:'dummy'})-[r0:PARENT_OF]->(s0)
MERGE (dummy)-[:PARENT_OF]->(s0)-[:PARENT_OF]->(s1)

```

But it adds two relationships between dummy and s0.  
When I add r0 to the second merge it gives me "Variable `r0` already declared":

```auto
MERGE (dummy{name:'dummy'})-[r0:PARENT_OF]->(s0)
MERGE (dummy)-[r0:PARENT_OF]->(s0)-[:PARENT_OF]->(s1)

```

Also, the same error if I remove :PARENT\_OF from it:

```auto
MERGE (dummy{name:'dummy'})-[r0:PARENT_OF]->(s0)
MERGE (dummy)-[r0]->(s0)-[:PARENT_OF]->(s1)

```

The nodes "dummy" and "s0" are bound correctly.

---

<div class="post-metadata">

**Author:** ![12kunal34](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/12kunal34/32/2617_2.png) [@12kunal34](https://community.neo4j.com/u/12kunal34)\
**Post date:** [August 19, 2019, 12:21pm UTC](https://community.neo4j.com/t/merge-bounding-relationships/9515/2 "2019-08-19T12:21:25Z")

</div>

I think you want to create below pattern:

**(dummy)-[:PARENT\_OF]-\>(s0)-[:PARENT\_OF]-\>(s1)**

so for this simply , you can write below query

**MERGE (dummy{name:'dummy'})-[r0:PARENT\_OF]-\>(s0)**  
**MERGE (s0)-[:PARENT\_OF]-\>(s1)**

you getting above errors because you using variables incorrectly .It will create ambiguity.  
for avoiding that best practice is always use lable name with variable
