title: PostgreSQL query select all but these
body: <p>table <strong>A</strong></p>
  
  <pre><code>reference, row, count, etc...
  </code></pre>
  
  <p>table <strong>B</strong></p>
  
  <pre><code>reference, row, xxx, etc...
  </code></pre>
  
  <p>how can  I get from table <strong>B</strong> all records with <em>reference</em> that are in <strong>A</strong>, excluding those rows with <em>row</em> that are in <strong>B</strong>?</p>
  
  <pre><code>select "reference", "row", "count", "xxx" 
  from B 
  where A.reference = B.reference and A.row != B.row
  </code></pre>