We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
(select start_date,x from (select start_date,row_number() over(order by start_date) x from projects where start_date not in (select end_date from projects)) e ) a join
(select end_date,y from (select end_date,row_number() over(order by end_date) y from projects where end_date not in (select start_date from projects)) t) b on a.x=b.y
order by Datediff(end_date, start_date), start_date
Cookie support is required to access HackerRank
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 →
select start_date,end_date from
(select start_date,x from (select start_date,row_number() over(order by start_date) x from projects where start_date not in (select end_date from projects)) e ) a join
(select end_date,y from (select end_date,row_number() over(order by end_date) y from projects where end_date not in (select start_date from projects)) t) b on a.x=b.y
order by Datediff(end_date, start_date), start_date