title: How to achieve chains in SQL
body: <p>I have an attendance sheet that appears as follows:</p>
  <p><img src="https://i.stack.imgur.com/c911q.png" alt="image here. " /></p>
  <p>I am trying to chain together the attendance of people (coded as ABC, DEF, etc.).
  And I want the final result to appear like this: which shows the start and end dates of each segment/chain of attendance. If person A attends from 2021-01-01 to 2021-01-4, then it should show up as one row because it's one contiguous chain. I am not sure what to do or where to start. It's an odd way attendance data is saved.</p>
  <p><img src="https://i.stack.imgur.com/HnjNq.png" alt="final output" /></p>
  <p><strong>More info:</strong> I don't know if this matters, but I have up to 20 columns because our attendance max is 20 people. So it's up to Col20.</p>