You are viewing a single comment's thread. Return to all comments →
WITH ProjectGroups AS ( SELECT Task_ID, Start_Date, End_Date, DATE_SUB(Start_Date, INTERVAL ROW_NUMBER() OVER (ORDER BY Start_Date) DAY) AS ProjectGroup FROM Projects ), ProjectDates AS ( SELECT MIN(Start_Date) AS startDate, MAX(End_Date) AS endDate, COUNT(*) AS total_time FROM ProjectGroups GROUP BY ProjectGroup )SELECT startDate, endDate FROM ProjectDates ORDER BY total_time ASC,startDate ASC;
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 →