title: Magento Sales Order tables
body: <p>Hello I am trying to get all customer who has bought this certain product. Although I am new to Magento So need your help. This is what I did so far .</p>
  
  <pre><code>SELECT o.customer_id,i.product_id ,i.NAME
  FROM sales_flat_order_item i INNER JOIN sales_flat_order o 
  ON o.entity_id = i.order_id
  WHERE o.customer_id IS NOT NULL
  AND product_id = '8' OR product_id = '14' OR product_id = '15' OR product_id = '16' ;
  </code></pre>
  
  <p>I need to get only the customers who's payment has been approved for these products(Where can I check that) .</p>
  
  <p>How this will work if the payments were made by recurring payments ?</p>
  
  <p>Please provide some way.</p>