title: mysql getting intersection of one table to three tables
body: <p>I have a table structure like this:</p>
  
  <pre><code>units
  +---------+---------+
  |    id   |   unit  |
  +---------+---------+
  |    1    |   lbs   |
  +---------+---------+
  |    2    |   cm    |
  +---------+---------+
  |    3    |   lit   |
  +---------+---------+
  |    4    |   cum   |
  +---------+---------+
  
  material
  +----+---------+--------------+
  | id | unit_id | material_name|
  +----+---------+--------------+
  | 1  |    3    |      pcb     |
  +----+---------+--------------+
  | 2  |    4    |      lbc     |
  +----+---------+--------------+
  
  equipment
  +----+---------+--------------+
  | id | unit_id |equipment_name|
  +----+---------+--------------+
  | 1  |    1    |      ber     |
  +----+---------+--------------+
  | 2  |    4    |      war     |
  +----+---------+--------------+
  
  project_items
  +----+---------+--------------+
  | id | unit_id | project_name |
  +----+---------+--------------+
  | 1  |    1    |      sec     |
  +----+---------+--------------+
  | 2  |    3    |      dum     |
  +----+---------+--------------+
  </code></pre>
  
  <p>I want to get only the <code>unit_id</code> where only exist in other 3 tables</p>
  
  <p><img src="https://i.stack.imgur.com/F3jo9.png" alt="enter image description here"></p>
  
  <p>I tried using inner join</p>
  
  <pre><code>SELECT u.id FROM  units u 
  INNER JOIN material m ON u.id = m.unit_id
  INNER JOIN equipment e ON u.id = e.unit_id
  INNER JOIN project_items i ON u.id = i.unit_id;
  </code></pre>
  
  <p>but this only select <code>id</code> that intersect on all tables, any ideas?</p>