title: SQL NOT IN Clause
body: <p>I have a query which is not working as expected</p>
  
  <pre><code>Q1:
  SELECT id, name 
  FROM vw_x 
  WHERE id NOT IN (select pid from table_x)
  GROUP BY id, name
  Having max(c_date) &gt; GETDATE()
  
  Q2:
  SELECT id, name 
  FROM vw_x 
  GROUP BY id, name
  Having max(c_date) &gt; GETDATE()
  </code></pre>
  
  <p>Q1 is not returning anything even though i know those ids are not in table_x
  Q2 runs correctly without NOT IN</p>
  
  <p>What could be wrong with my query?</p>