# Inner joins and outer joins

**URL:** <https://www.ruby-forum.com/t/inner-joins-and-outer-joins/173361>\
**Category:** Rails\
**Created:** [August 7, 2009, 9:25am UTC](https://www.ruby-forum.com/t/inner-joins-and-outer-joins/173361 "2009-08-07T09:25:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akramwasim1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Post date:** [August 7, 2009, 9:25am UTC](https://www.ruby-forum.com/t/inner-joins-and-outer-joins/173361/1 "2009-08-07T09:25:40Z")

</div>

can anybody guide me on how to create inner joins and left and right  
outer joins in RoR as both the tables has “has and belongs to many  
relationships” and there is ajoin table as well

---

<div class="post-metadata">

**Author:** ![akramwasim1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Post date:** [August 7, 2009, 5:47pm UTC](https://www.ruby-forum.com/t/inner-joins-and-outer-joins/173361/2 "2009-08-07T17:47:25Z")

</div>

Wasim Akram wrote:

> can anybody guide me on how to create inner joins and left and right  
> outer joins in RoR as both the tables has “has and belongs to many  
> relationships” and there is ajoin table as well

all joins are implicitly “inner”. If you want to use either a right or  
left outer join then you just state them in your join clause…

Model.find(:all, :joins =\> "right outer join … ") etc…

hth

ilan
