title: MIN/MAX price for each product (query)
body: <h2>The goal</h2>
  
  <p>Select MIN/MAX price of each product in database.</p>
  
  <h2>The problem</h2>
  
  <p>I am able to get only products with specified identifiers.</p>
  
  <h2>What I have</h2>
  
  <p>I'm using <strong><em>MySQL</em></strong> and I have the follow query:</p>
  
  <pre><code>SELECT (MIN(`map`.`Product_Price`)) as `minProductPrice`,
      (MAX(`map`.`Product_Price`)) as `maxProductPrice`,
      `pr`.`Product_Name` as `productName`
  FROM `bm_market_products` as `map`
  JOIN `bm_products` as `pr`
  JOIN `bm_markets` as `ma`
  WHERE `map`.`Product_Id` = 1
  AND `map`.`Product_Id` = `pr`.`Product_Id`
  </code></pre>
  
  <p>My return is the <code>minProductPrice</code>, <code>maxProductPrice</code> and <code>productName</code>.</p>
  
  <h2>The solution</h2>
  
  <p>Thank you about your help. The both answers above are right — but I chose @GordonLinoff answer's as accepted because I think it will be more useful and enjoyed by beginners — but really thanks to you both guys. <strong>The final query:</strong></p>
  
  <pre><code>SELECT MIN(`map`.`Product_Price`) as `minProductPrice`,
         MAX(`map`.`Product_Price`) as `maxProductPrice`,
         `pr`.`Product_Name` as `productName`
  FROM `bm_market_products` `map` join
       `bm_products` as `pr`
       on map`.`Product_Id` = `pr`.`Product_Id`
  group by `map`.`Product_Id`
  </code></pre>
  
  <p>Cheers!</p>