How can I use LEAD LAG-like functions on multiple columns simultaneously
I guess one could order by coalesce(start_data, end_date)


WITH cte AS (
SELECT COALESCE(start_data, end_date) dt, 
       ROW_NUMBER() OVER (ORDER BY COALESCE(start_data, end_date)) rn
FROM datatable
)
SELECT MIN(dt) start_data, MAX(dt) end_date
FROM cte
GROUP BY ROUND((rn-1)/2)


This query is a model. The final text is dependent by DBMS.

Maybe you will need to replace MIN/MAX with CASE WHEN rn%2 = [0|1]