title: How to identify overlapping rows
body: <p>I need to identify overlapping rows. Below is the table and I need the column overlapping:</p>
  <pre><code>| identifier    | status    | startDate     | endDate       | pID   | OVERLAPPING   |
  |------------   |---------- |------------   |------------   |-----  |-------------  |
  | A             | Approved  | 2020-10-01    | 2020-10-07    | x1    | Yes           |
  | A             | Approved  | 2020-10-01    | 2020-10-07    | x2    | No            |
  | A             | Approved  | 2020-10-01    | 2020-10-07    | x3    | Yes           |
  | A             | Approved  | 2020-10-01    | 2020-10-07    | x4    | No            |
  | B             | Approved  | 2020-10-10    | 2020-10-12    | x2    | No            |
  | B             | Approved  | 2020-10-10    | 2020-10-12    | x5    | No            |
  | C             | Rejected  | 2020-10-05    | 2020-10-06    | x3    | No            |
  | C             | Rejected  | 2020-10-05    | 2020-10-06    | x7    | No            |
  | C             | Rejected  | 2020-10-05    | 2020-10-06    | x8    | No            |
  | C             | Rejected  | 2020-10-05    | 2020-10-06    | x9    | No            |
  | D             | Approved  | 2020-10-01    | 2020-10-07    | x5    | No            |
  | D             | Approved  | 2020-10-01    | 2020-10-07    | x1    | Yes           |
  | E             | Approved  | 2020-10-03    | 2020-10-04    | x3    | Yes           |
  </code></pre>
  <ol>
  <li>Since C is in rejected status anything with C identifier will not be counted for finding overlapped rows. So even tough x3 in C is overlapping with x3 in A, it will not be counted as overlapped.</li>
  <li>x1 is overlapping in A and D. So both rows will be counted as overlapped.</li>
  <li>x3 in A is overlapping with x3 in E as the start date and end date of E is within the period of A.</li>
  <li>x5 in B and D are not overlapping as the dates for both B and D are not overlapping.</li>
  </ol>
  <p>I am able to get this if start date and end dates are same by creating a column which is combination of start date, end date and pID and then counting this field for all rows. If it is more than 1 then I am marking overlapping. But this is not covering scenario of x3 where start date and date are not same but still overlapping for some duration.</p>