# Join association across two databases with :through

**URL:** <https://discuss.rubyonrails.org/t/join-association-across-two-databases-with-through/14764>\
**Category:** rubyonrails-talk\
**Created:** [June 22, 2007, 3:16pm UTC](https://discuss.rubyonrails.org/t/join-association-across-two-databases-with-through/14764 "2007-06-22T15:16:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_B](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@Bob\_B](https://discuss.rubyonrails.org/u/Bob_B)\
**Post date:** [June 22, 2007, 3:16pm UTC](https://discuss.rubyonrails.org/t/join-association-across-two-databases-with-through/14764/1 "2007-06-22T15:16:06Z")

</div>

Hi,

I'm trying to join two tables that are in different databases. I tried using :through but I'm getting complaints about trying to span databases. I've also tried find\_by\_sql and just plopped the SQL into the function but I get complaints about one user not being able to access the other database. I know I could just make both databases accessible by the same username/password pair but, besides being hacky, I don't have control of the databases.

Thanks for any help you can give me on this, Bob
