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.
This is more simpler solution using "TABIBITOSAN METHOD"
select sd,ed from (
select MIN(start_date) as sd,MAX(end_date) as ed,(MAX(end_date)- MIN(start_date)) as day_diff from
(
select end_date-1 as start_date
,end_date as end_date
,row_number() over (order by end_date) as rn
,end_date-row_number() over (order by end_date) as end_date_grp
from projects
)
GROUP BY end_date_grp
ORDER BY 3,1
);
SQL Project Planning
You are viewing a single comment's thread. Return to all comments →
This is more simpler solution using "TABIBITOSAN METHOD"
select sd,ed from ( select MIN(start_date) as sd,MAX(end_date) as ed,(MAX(end_date)- MIN(start_date)) as day_diff from ( select end_date-1 as start_date ,end_date as end_date ,row_number() over (order by end_date) as rn ,end_date-row_number() over (order by end_date) as end_date_grp from projects ) GROUP BY end_date_grp ORDER BY 3,1 );
You can refer the link to understand what is tabibitosan method, https://community.oracle.com/docs/DOC-915680
Thanks, Madhan