[HackerRank SQL] SQL Project Planning

문제 link
https://www.hackerrank.com/challenges/sql-projects/problem

Code link
https://github.com/JamesJung01/Hackerrank_sql/blob/main/02_Medium/SQL_Proejct_Planning.sql

SET sql_mode = '';
SELECT Start_Date, End_Date
FROM 
    (SELECT Start_Date FROM Projects WHERE Start_Date NOT IN (SELECT End_Date FROM Projects)) a,
    (SELECT End_Date FROM Projects WHERE End_Date NOT IN (SELECT Start_Date FROM Projects)) b 
WHERE Start_Date < End_Date
GROUP BY Start_Date 
ORDER BY DATEDIFF(End_Date, Start_Date), Start_Date

좋은 웹페이지 즐겨찾기