title: Intersect on just one column, return others
body: <p>I am trying to do an intersection on just one column (map_id), but also return another column (attr):</p>
  
  <pre><code>SELECT map_id, attr 
  FROM Attr
  WHERE attr_id = 0 AND val = '123'
  INTERSECT
  SELECT map_id, attr
  FROM Attr
  WHERE attr_id = 20 AND val = '456' 
  </code></pre>
  
  <p>However, if the pair map_id and attr don't match, the intersection doesn't work (obviously). How do I do the intersection on map_id, but return the list of attrs? It eventually becomes part of a col In () clause of a larger query. </p>
  
  <p>For example:</p>
  
  <pre><code>---------------------------------
  Attr_Id    Attr    Val    Map_Id
  ---------------------------------
  0          '1'     '123'    1
  0          '2'     '123'    2
  10         '3'     '123'    1
  10         '4'     '123'    2
  20         '5'     '456'    1
  20         '6'     '456'    2
  30         '7'     '456'    1
  30         '8'     '456'    2
  </code></pre>
  
  <p>I want it to return </p>
  
  <pre><code>----------------
  Attr_Id    Attr   
  ----------------
  0          '1'   
  20         '5'  
  </code></pre>