title: How to make a "distinct" join with MySQL
body: <p>I have two MySQL tables (product and price history) that I would like to join:</p>
  
  <p><code>Product</code> table:</p>
  
  <pre><code>Id = int
  Name = varchar
  Manufacturer = varchar
  UPC = varchar
  Date_added = datetime
  </code></pre>
  
  <p><code>Price_h</code> table:</p>
  
  <pre><code>Id = int
  Product_id = int
  Price = int
  Date = datetime
  </code></pre>
  
  <p>I can perform a simple LEFT JOIN:</p>
  
  <pre><code>SELECT Product.UPC, Product.Name, Price_h.Price, Price_h.Date
  FROM Product
  LEFT JOIN Price_h
  ON Product.Id = Price_h.Product_id;
  </code></pre>
  
  <p>But as expected if I have more than one entry for a product in the price history table, I get one result for each historical price.</p>
  
  <p>How can a structure a join that will only return one instance of each produce with only the newest entry from the price history table joined to it?</p>