title: SQL join between multiple independent tables
body: <p>I have the following 4 tables with unique data</p>
  <p>Table: Cars</p>
  <pre><code>ID  Name    Status
  1   Benz    available
  2   Toyota  not-available
  3   Maruthi null
  </code></pre>
  <p>Table: Bikes</p>
  <pre><code>ID  Name      Status
  1   Yamaha    available
  2   Honda     not-available
  3   Hero      null
  </code></pre>
  <p>Table: Buses</p>
  <pre><code>ID  Name      Status
  1   Benz      available
  2   Leyland   not-available
  3   Tata      null
  </code></pre>
  <p>The above three tables are connected in a different table for some purpose like</p>
  <p>Table: Connections</p>
  <pre><code>ID  Entity_id      Entity_type
  1   1              car
  2   2              car
  3   1              bike
  4   2              bike
  5   1              bus
  6   2              bus
  7   3              bus
  </code></pre>
  <p>I need to fetch records from the above connections table with <strong>status 'available'</strong> of each entity.</p>
  <p>result example:</p>
  <pre><code>ID  Entity_id      Entity_type
  1   1              car
  3   1              bike
  5   1              bus
  </code></pre>
  <p>I tried with joins but had no luck and some docs suggested to have union between 3 individual join queries which I don't want to do.</p>
  <p>Thanks</p>