title: SELECT query return 1 row from each group
body: <p>This is a product table and have few million of records.<br><br>
  <img src="https://i.stack.imgur.com/81tYt.png" alt="enter image description here"></p>
  
  <p>I want to list record as below:<br>Normally I use:</p>
  
  <pre><code>SELECT id, 
         product_name, 
         store_id 
  FROM product
  GROUP BY store_id 
  ORDER BY id.
  </code></pre>
  
  <p><br>Currently having SQL performance issue. I need SQL query to output result like this.</p>
  
  <p><img src="https://i.stack.imgur.com/fBqvW.png" alt="enter image description here"></p>