title: MySQL Selecting Linked Rows
body: <p>I have two tables:</p>
  
  <p>Table "A":</p>
  
  <pre><code>+----------+
  | item_id  |
  +----------+
  | 10       |
  | 20       |
  | 30       |
  | 40       |
  +----------+
  </code></pre>
  
  <p>and table "B":</p>
  
  <pre><code>+----------+-------------+
  | item_id  |   user_id   |
  +----------+-------------+
  | 10       | 1           |
  | 10       | 2           |
  | 20       | 1           |
  | 30       | 2           |
  +----------+-------------+
  </code></pre>
  
  <p>the field "item_id" is a common field. </p>
  
  <p>If i wish to select all rows from table A where both users 1 and 2 exist (but not the rows where only one of the two exists), how might I got about building this query? (I'm looking to have one row in the result where item_id is 10).</p>