title: MYSQL: Exclude Rows in join if row in join table matches
body: <p>let's say i have the following two tables: </p>
  
  <pre><code>Table Orders
  ID | Order_ID | Products_ID
  1       a          22912
  2       b          22912
  3       c          22912
  
  Table Products
  ID     | more stuff
  22912     lorem ipsum
  </code></pre>
  
  <p>So far really easy. With joins i can get every info i want. But i want a joined query thats returns Null if a Product has a order from a sepcial order id. That means if i get a match on order id then null should be returned for the product.</p>
  
  <p>i tried in different ways: </p>
  
  <pre><code>SELECT * FROM Products p JOIN orders o ON p.ID=o.Products_ID WHERE Order_ID !='a'
  </code></pre>
  
  <p>with that i'll get the 2 for b &amp; c order id. </p>
  
  <p>Allright next try: </p>
  
  <pre><code>select * from Products p JOIN (select * FROM Orders o WHERE WHERE Order_ID !="a") jo ON p.ID=jo.Product_ID
  </code></pre>
  
  <p>Hmm same query, same result. Result should be empty if one Order_ID matches. Anyone an Idea how to solve that within one query. I think the second query is the key but how to write the subquery that it returns empty result?  </p>