You are viewing a single comment's thread. Return to all comments →
with t1 as( select *, lag(end_date,1,null) over(order by start_date) as previous_date from projects), t2 as( select *, sum(case when start_date=previous_date then 0 else 1 end) over(order by start_date) as commulative_sum from t1 ) select min(start_date), max(end_date) from t2 group by commulative_sum order by count(commulative_sum);
Seems like cookies are disabled on this browser, please enable them to open this website
SQL Project Planning
You are viewing a single comment's thread. Return to all comments →