Having a simple task (called projects) table with task_id, start and end dates, identify begin and end date for groups of tasks that are back 2 back. Back 2 back (b2b), means that a task starts on the same date where another ended.
2 solutions:
I approached the solution as one where you needed to group the b2b tasks by its root or beggining task. As this is a tree, I used recursion through common table expressions (CTEs).