title: How to get all potential orders from a mysql table
body: <p>I have a mysql query and can't quite figure out how to pull up all potential customers for a certain <code>product_id</code> from a given <code>country_id</code>.  I want a result that has just one record per customer.<br>
  My tables are <code>orders</code> and <code>customers</code>.</p>
  
  <pre><code>---customers--
  customer_id
  country_id
  name
  ---orders---
  order_id
  product_id
  customer_id
  </code></pre>
  
  <p>My current query below gives too many results.  Namely records from other <code>product_id</code>'s that are not = 1.  Here is my query:</p>
  
  <pre><code>SELECT o.order_id
       , c.name
       , c.customer_id
       , c.country_id
       , o.product_id 
    FROM customers c 
    LEFT 
    JOIN orders o 
      ON o.customer_id = c.customer_id 
   WHERE o.product_id = 1 
      OR c.country_id = 1
  </code></pre>
  
  <p>Some sample results might look like this:</p>
  
  <pre><code>order_id    name        customer_id country_id product_id
  1           Joe Smith   1           1          1
  2           Joe Smith   1           1          2
  3           John Doe    2           1          1
  4           Kirk Smith  3           1          1
  NULL        Ron Rhoden  6           1          1
  NULL        Sam Smith   7           1          1
  </code></pre>
  
  <p>For my purposes you can assume that a given customer will only order a given product once.  Notice how I get a result for Joe Smith with <code>product_id=2</code>.  I don't want that result in my list.  The Ron Rhoden and Sam Smith results are desirable for my purposes.  How do I filter the <code>product_id&lt;&gt;1</code> records but still include all the <code>country_id=1</code> records?
  Thanks.</p>