title: mysql get first and last entry with same value in other column
body: <p>I have a table with a date column and a price column.
  The date column has a row for each day of the year.</p>
  
  <p>The table is like this:</p>
  
  <pre><code>2017-09-01 158.00
  2017-09-02 158.00
  2017-09-03 158.00
  2017-09-04 158.00
  etc.
  2017-09-10 175.00
  2017-09-11 175.00
  etc.
  2017-10-20 158.00
  2017-10-21 158.00
  </code></pre>
  
  <p>I want to get the first date and last date in a time range that has same price.</p>
  
  <p>So the result for above should be:</p>
  
  <pre><code>    2017-09-01 -- 2017-09-04 158 euro.
      2017-09-10 -- 2017-09-11 175 euro.
      2017-10-20 -- 2017-10-21 158 euro.
  </code></pre>