title: SQL subqueries alternative to INTERSECT
body: <p>I have two tables:
  <code>P</code> and <code>PC</code> (master/detail joined by the column Id)</p>
  
  <pre><code>Table P:
  Id integer
  Name varchar(12)
  
  Table PC:
  Id   integer
  Code varchar(12)
  Val  number
  </code></pre>
  
  <p>I want to get all Names from P that satisfy the following simultaneous conditions:</p>
  
  <ul>
  <li><p>have a PC with <code>PC.Code='A'</code> and <code>Val&gt;100</code></p></li>
  <li><p>have another PC with  <code>PC.Code='B'</code> and <code>Val&gt;80</code></p></li>
  </ul>
  
  <p>In summary, I'm only interested in those P.Name where the details comply with both conditions. Is there a way to select without resorting to INTERSECT?</p>
  
  <p>The INTERSECT query is:</p>
  
  <pre><code>Select P.Name 
    from P, PC
   where P.Id=PC.Id
     and PC.Code='A' and Val&gt;100
  INTERSECT
  Select P.Name 
    from P, PC
   where P.Id=PC.Id
     and PC.Code='B' and Val&gt;80
  </code></pre>
  
  <p>(The interest is to check performance and also to allow the query to be run in Access)</p>