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.
with tasks_with_flag - adds new column prev_end which shows end_date of previous row
with tasks_with_project - if prev_end is equal to start_date, that means it is same project. if same project make new column 0 if different project make new column 1. Now cumulative sum will increase by 1 if there is a new project. hence giving new number to each project
then finally showing min start date and max end date for each project . And sorting by no of days and 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 →