title: MySQL : group by column and get date range
body: <p>I have a table like this</p>
  
  <pre><code>id - price - date
  1  - 10    - 01/01/2017
  2  - 10    - 02/01/2017
  3  - 10    - 03/01/2017
  4  - 10    - 04/01/2017
  5  - 10    - 05/01/2017
  6  - 20    - 06/01/2017
  7  - 20    - 07/01/2017
  8  - 20    - 08/01/2017
  9  - 20    - 09/01/2017
  10 - 10    - 10/01/2017
  11 - 10    - 11/01/2017
  12 - 10    - 12/01/2017
  13 - 10    - 13/01/2017
  </code></pre>
  
  <p>And I want to show result this way</p>
  
  <pre><code>10 - 01/01/2017 - 05/01/2017
  20 - 06/01/2017 - 09/01/2017
  10 - 10/01/2017 - 13/01/2017
  </code></pre>
  
  <p>My query is</p>
  
  <pre><code>SELECT price, min(date), max(date) FROM mytable GROUP BY price
  </code></pre>
  
  <p>but result is</p>
  
  <pre><code>20 - 06/01/2017 - 09/01/2017
  10 - 10/01/2017 - 13/01/2017
  </code></pre>
  
  <p>Can I get right result with mysql query or must find a php solution?</p>