You are viewing a single comment's thread. Return to all comments →
MySQL:
WITH table AS (SELECT *, End_Date - ROW_NUMBER() OVER (ORDER BY End_Date) AS gr FROM Projects)
SELECT MIN(Start_Date) AS Start_Date, MAX(End_Date) AS End_Date FROM table1 GROUP BY gr ORDER BY COUNT(*), MIN(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 →
MySQL:
WITH table AS (SELECT *, End_Date - ROW_NUMBER() OVER (ORDER BY End_Date) AS gr FROM Projects)
SELECT MIN(Start_Date) AS Start_Date, MAX(End_Date) AS End_Date FROM table1 GROUP BY gr ORDER BY COUNT(*), MIN(Start_Date) ;