Dont understand why my answer doesn't work...The logic is very straight forward. And the error information shows no diff with standard answers


  • 0
    D

    My query logic is simple, find the middle day of the 3 consecutive day, and then union the day before, and the day after, then it's all consecutive day

    (select s2.id, s2.date, s2.people from stadium s2, stadium s1, stadium s3  where to_days(s1.date)+1 = to_days(s2.date) and to_days(s2.date)+1=to_days(s3.date) and s1.people>=100 and s2.people>=100 and s3.people>=100)
    union
    (select s1.id, s1.date, s1.people from stadium s2, stadium s1, stadium s3  where to_days(s1.date)+1 = to_days(s2.date) and to_days(s2.date)+1=to_days(s3.date) and s1.people>=100 and s2.people>=100 and s3.people>=100)
    union
    (select s3.id, s3.date, s3.people from stadium s2, stadium s1, stadium s3  where to_days(s1.date)+1 = to_days(s2.date) and to_days(s2.date)+1=to_days(s3.date) and s1.people>=100 and s2.people>=100 and s3.people>=100) 
    
    
    order by id
    

  • 0
    K
    This post is deleted!

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.