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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. SQL
  3. Advanced Join
  4. SQL Project Planning
  5. Discussions

SQL Project Planning

Problem
Submissions
Leaderboard
Discussions

    You are viewing a single comment's thread. Return to all comments →

  • mayank912912
    2 months ago+ 0 comments

    mysql solution

    select start_date, end_date 
    from 
    (select start_date, row_number() over(order by start_date) as x from projects where start_date not in (select end_date from projects)) as a  join 
    
    (select end_date, row_number() over(order by end_date) as y  from projects where end_date not in (select start_date from projects)) as b 
    on a.x = b.y
    
    order by datediff(end_date, start_date), 1
    
    -1|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy