title: SELECT DISTINCT on one column, with multiple columns in mysql
body: <p>I have to display result with select multiple column but distinct on only one column i have also used following queries and also refereed below link.</p>
  
  <p>Query One.</p>
  
  <pre><code>select category , offer_id, store_image from  `tbl_coupan_offer` where
  `offer_id` in (Select max(`offer_id`) FROM  `tbl_coupan_offer` group by `category`)  
  </code></pre>
  
  <p>Above queries return all record with including duplicate</p>
  
  <p>I want only display distinct category not repeated</p>
  
  <p>Following is image </p>
  
  <p><a href="https://i.stack.imgur.com/LAKkD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LAKkD.png" alt="enter image description here"></a>  </p>
  
  <p>On image you can see Travel and Accessorises repeated </p>
  
  <p>Second query </p>
  
  <pre><code>SELECT DISTINCT `category`,`offer_id`,`store_image` FROM `tbl_coupan_offer` 
  </code></pre>
  
  <p>I also refereed this link <a href="https://stackoverflow.com/questions/41894413/select-all-columns-from-rows-distinct-on-one-column">Select all columns from rows distinct on one column</a></p>