title: mysql check if field value exists in another table
body: <p>TABLE PRODUCTS</p>
  
  <pre><code>ProductID   | ProductCode  | SampleRefNum
  1              a1
  2                             b2
  3                             c2
  </code></pre>
  
  <p>TABLE STOCK LIST</p>
  
  <pre><code>  StockListID   | ProductCode  | SampleRefNum  | QTY
      1              a1                            10
      2                             b2             10
      3                             j100           25
  </code></pre>
  
  <p>I have to 2 tables. The products tables is the current products on the site.
  Stock list table is a list uploaded from the POS system , with products and their quantities.
  Products either have a ProductCode or SampleRefNum . </p>
  
  <p>I am trying to generate a list off all items in the product table that do not have a matching ProductCode or SampleRefNum in the stock list table. in the following e.g the query should return ProductID 3 .</p>
  
  <p>I'm trying to do this with a query , instead of looping and checking results in PHP.</p>