title: Group consecutive rows of same value using time spans
body: <p>Sorry for the vague title (I just don't know how to describe this conundrum)</p>
  
  <p>Give the following schedule table for a classroom:</p>
  
  <pre><code>╔═══════════╦════════════╦═══════════╦═══════════╦═════════╗
  ║ Classroom ║ CourseName ║  Lesson   ║ StartTime ║ EndTime ║
  ╠═══════════╬════════════╬═══════════╬═══════════╬═════════╣
  ║      1001 ║ Course 1   ║ Lesson 1  ║      0800 ║    0900 ║
  ║      1001 ║ Course 1   ║ Lesson 2  ║      0900 ║    1000 ║
  ║      1001 ║ Course 1   ║ Lesson 3  ║      1000 ║    1100 ║
  ║      1001 ║ Course 2   ║ Lesson 10 ║      1100 ║    1200 ║
  ║      1001 ║ Course 2   ║ Lesson 11 ║      1200 ║    1300 ║
  ║      1001 ║ Course 1   ║ Lesson 4  ║      1300 ║    1400 ║
  ║      1001 ║ Course 1   ║ Lesson 5  ║      1400 ║    1500 ║
  ╚═══════════╩════════════╩═══════════╩═══════════╩═════════╝
  </code></pre>
  
  <p>I would like to group the table to display this:</p>
  
  <pre><code>╔═══════════╦════════════╦═══════════╦═════════╗
  ║ Classroom ║ CourseName ║ StartTime ║ EndTime ║
  ╠═══════════╬════════════╬═══════════╬═════════╣
  ║      1001 ║ Course 1   ║      0800 ║    1100 ║
  ║      1001 ║ Course 2   ║      1100 ║    1300 ║
  ║      1001 ║ Course 1   ║      1300 ║    1500 ║
  ╚═══════════╩════════════╩═══════════╩═════════╝
  </code></pre>
  
  <p>Basically we are looking at a schedule that show which crouse is using what classroom during a certain timespan...</p>
  
  <p>My initial thought was:
  Group by <code>Classroom</code> and <code>CourseName</code> and take <code>Max</code> and <code>Min</code> for <code>start\end</code> time but that will not give me the time spans it will show as if Course 1 is using the <code>Classroom</code> from 08:00 - 16:00 with no break in the middle.</p>