# Query with joins repeats first match

**URL:** <https://forums.percona.com/t/query-with-joins-repeats-first-match/138>\
**Category:** Other MySQL® Questions\
**Created:** [December 5, 2006, 5:42am UTC](https://forums.percona.com/t/query-with-joins-repeats-first-match/138 "2006-12-05T05:42:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![migandhi](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@migandhi](https://forums.percona.com/u/migandhi)\
**Post date:** [December 5, 2006, 5:42am UTC](https://forums.percona.com/t/query-with-joins-repeats-first-match/138/1 "2006-12-05T05:42:48Z")

</div>

## i am facing a problem in a join query . it contains multiple joins . the output for example is like ,

10 abc 123

10 abc 123

## 10 abc 123

and so on …

i tried it with and without indexing .  
but the result set is the same.  
the first match in the query is repeated .  
the tables are Innodb type , which would also permit foreign key.  
i am working on version 5.0

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [December 5, 2006, 6:26am UTC](https://forums.percona.com/t/query-with-joins-repeats-first-match/138/2 "2006-12-05T06:26:36Z")

</div>

You should supply your schema and explain for your query if you want reasonable answer.

---

<div class="post-metadata">

**Author:** ![migandhi](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@migandhi](https://forums.percona.com/u/migandhi)\
**Post date:** [December 5, 2006, 9:43am UTC](https://forums.percona.com/t/query-with-joins-repeats-first-match/138/3 "2006-12-05T09:43:33Z")

</div>

Sir ,  
Please see attached Explain result.  
And i hope it is useful.

---

<div class="post-metadata">

**Author:** ![migandhi](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@migandhi](https://forums.percona.com/u/migandhi)\
**Post date:** [December 23, 2006, 12:05am UTC](https://forums.percona.com/t/query-with-joins-repeats-first-match/138/4 "2006-12-23T00:05:46Z")

</div>

Hi,  
i found out the issues that were leading to it.  
1: redundant data in one of the tables .  
2: Use of IS NULL in conditions.

So the JOINS work normally . And i also have to say it is fast .

thanks.
