title: Inner join between three tables in mysql
body: <p>I have 3 tables called</p>
  
  <ul>
  <li>Companies</li>
  <li>Contacts </li>
  <li>Campaigns</li>
  </ul>
  
  <p>Contacts has foreign key  of companies. Companies has foreign key of campaigns. All of them have a column 'name'. I need a join table which will have contact name company name and campaign name.</p>
  
  <pre><code>contact
  id   name company_id
  companies
  id   name campaign_id
  campaigns
  id   name company_id
  </code></pre>