title: 2 Table Query Proper Protocol
body: <p>I have a search results query that I need to modify so that it does not show products that are already sold. So here is the non modified select statement as it exists currently:</p>
  
  <pre><code>SELECT id, cid, sid, posttitle, postdetails, city, `state`, zipcode 
  FROM posts 
  ORDER BY datepublished DESC
  </code></pre>
  
  <p>I need to modify that so that it looks to the <code>orderdetails table under</code>DetailProductID` to see if it exists and if it does to now show it; So in essence in English it would be something like this:</p>
  
  <pre><code>SELECT id, cid, **etc** 
  FROM posts 
  WHERE posts.id NOT IN orderdetails.DetailProductID
  </code></pre>