title: ORACLE SQL - Connecting overlapping timeframes
body: <p>I have the following table:</p>
  
  <pre><code> ╔══════╦═══════════╦═════════╗
   ║ Emp# ║ StartDate ║ EndDate ║
   ╠══════╬═══════════╬═════════╣
   ║    1 ║ 1Jan      ║ 15Jan   ║
   ║    1 ║ 3Jan      ║ 5Jan    ║
   ║    1 ║ 10Jan     ║ 20Jan   ║
   ║    1 ║ 23Jan     ║ 25Jan   ║
   ║    1 ║ 24Jan     ║ 27Jan   ║
   ╚══════╩═══════════╩═════════╝
  </code></pre>
  
  <p>I need to create a query that will connect the overlaps perfectly so that for each possible <strong>calendar date</strong> there is at most 1 Row per employee. The output should be as follows:</p>
  
  <pre><code> ╔══════╦═══════════╦═════════╗
   ║ Emp# ║ StartDate ║ EndDate ║
   ╠══════╬═══════════╬═════════╣
   ║    1 ║ 1Jan      ║ 20Jan   ║
   ║    1 ║ 23Jan     ║ 27Jan   ║
   ╚══════╩═══════════╩═════════╝
  </code></pre>
  
  <p>I tried to do it with Self-Joins but I would need X self-joins for X overlaps. I would appreciate any direction to finding a solution. 
  Thank you very much in advance!</p>