title: Overlapping Dates Oracle
body: <p>I have a set of date range where it can either have config values as 'S' or 'D', but the underling date range can have overlap dates and i am trying to get the config values for the respective date.</p>
  <p>Note: if the config value is 'D' the date range will be within a data range of another row containing config value 'S' if exists.</p>
  <p>Data:</p>
  <pre><code>Start_DATE       End_Date    Config
  01-Jan-2020      31-Jan-2020    S
  15-Jan-2020      20-Jan-2020    D
  15-Feb-2020      20-Feb-2020    D
  01-Mar-2020      20-Mar-2020    S
  </code></pre>
  <p>I wanted an output like</p>
  <pre><code>Start_DATE       End_Date    Config
  01-Jan-2020      14-Jan-2020    S
  15-Jan-2020      20-Jan-2020    D
  16-Jan-2020      31-Jan-2020    S
  15-Feb-2020      20-Feb-2020    D
  01-Mar-2020      20-Mar-2020    S
  </code></pre>
  <p>Tried a number of things, but nothing get this quite correctly for me..</p>
  <p>Logic:</p>
  <ol>
  <li>There can be overlapping Config value 'S' or 'D' on a given date
  range.</li>
  <li>the Query should extract where for the date range is 'S' or
  'D'</li>
  </ol>