I need a help with a query that should split some overlapping date intervals in the following way.
For example if we have a following table
----------------------------------------------------------------------
| column_name | value | start_date | end_date |
----------------------------------------------------------------------
| column1 | value1 | 03-09-2020 | 26-09-2020 |
----------------------------------------------------------------------
| column1 | value2 | 07-09-2020 | 20-09-2020 |
----------------------------------------------------------------------
I have a problem coming up with a query to make the following output:
----------------------------------------------------------------------
| column_name | value | start_date | end_date |
----------------------------------------------------------------------
| column1 | value1 | 03-09-2020 | 07-09-2020 |
----------------------------------------------------------------------
| column1 | value2 | 07-09-2020 | 20-09-2020 |
----------------------------------------------------------------------
| column1 | value1 | 20-09-2020 | 26-09-2020 |
----------------------------------------------------------------------