title: MySQL select statement with MIN
body: <p>I have two tables in a MySQL database.  Products and product items.  Products contains fields product_id, product_name, image.  Product item contains field item_id, product_id, size_id, doq_id, price.</p>
  
  <p>There are many product items for one product.  </p>
  
  <p>How do I write a statement which returns the lowest price for each product?</p>
  
  <p>I have the following:</p>
  
  <pre><code>SELECT p.product_name, p.image, p.product_id, MIN(pi.price) AS price
  FROM (`product_items` as pi, `product` as p) 
  WHERE `pi`.`product_id` = 'p.product_id' 
  GROUP BY `p`.`product_name` 
  ORDER BY RAND() 
  LIMIT 3
  </code></pre>
  
  <p>But this is returning an empty data set.</p>