I have two MySQL tables (product and price history) that I would like to join:
Product table:
Product
Id = int Name = varchar Manufacturer = varchar
SELECT Product.UPC, Product.Name, Price_h.Price, Price_h.Date FROM Product LEFT JOIN Price_h ON (Product.Id = Price_h.Product_id AND Price_h.Date = (SELECT MAX(Date) FROM Price_h ph1 WHERE ph1.Product_id = Product.Id));