title: Select unique value based on a couple of columns in mysql
body: <p>Hi I have a query that I have built as follows</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT brand, model, buyer_rate, DATE_ADD(finish_dt, INTERVAL 33 HOUR), bid_price, g.status, ga.idx AS gai, ab.idx as abi 
  FROM auction_bid ab 
  INNER JOIN goods_auction ga ON ab.goods_auction_idx=ga.idx 
  INNER JOIN auction_info ai ON ga.auction_info_idx=ai.idx 
  INNER JOIN goods g ON ai.goods_idx= g.idx 
  INNER JOIN user u on g.user_idx=u.idx 
  WHERE g.status='A008' AND DATEDIFF(Now(), ab.created_at)&lt;5 GROUP BY bid_price DESC, ab.created_at
  </code></pre>
  <p>The result of the query is something like the picture below
  <a href="https://i.stack.imgur.com/76Bj6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/76Bj6.png" alt="enter image description here" /></a></p>
  <p>The result that I am hoping to retrieve is the maximum bid_price value for the same brand and model.</p>
  <p>So in this case I would like to retrieve the 1st and 10th row.</p>
  <p>Would there be any way to edit my existing query to get this desired result.</p>
  <p>Thank you in advance</p>