You are viewing a single comment's thread. Return to all comments →
with cte1 as( select start_date, row_number() over (order by start_date) as rn1 from projects where start_date not in( select end_date from projects) ) ,cte2 as( select end_date, row_number() over (order by start_date) as rn2 from projects where end_date not in( select start_date from projects) ) select cte1.start_date,cte2.end_date from cte1,cte2 where rn1=rn2 order by datediff(day,cte1.start_date,cte2.end_date) asc, cte1.start_date;
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 →