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.
MS SQL Server solution
* Uses two CTEs for improving readability
* Uses the lag window function to determine the start of a new project (first CTE)
* Uses the sum window function to compute the project groups (second CTE)
* Group by proj_grp to find the start_date and end_date of each project and order by number of days (count(1)) and start_date
SQL Project Planning
You are viewing a single comment's thread. Return to all comments →
MS SQL Server solution * Uses two CTEs for improving readability * Uses the lag window function to determine the start of a new project (first CTE) * Uses the sum window function to compute the project groups (second CTE) * Group by proj_grp to find the start_date and end_date of each project and order by number of days (count(1)) and start_date