Accepted solutions--easy to understand


  • 0
    H

    '''
    select distinct a.id id, a.date date, a.people people
    from stadium a, stadium b, stadium c
    where ((a.id=b.id-1 and a.id=c.id-2) or (a.id=b.id+1 and a.id=c.id-1) or (a.id=b.id+2 and a.id=c.id+1)) and (a.people>=100 and b.people>=100 and c.people>=100)
    order by date;
    '''

    or

    '''
    select distinct a.id id, a.date date, a.people people
    from stadium a, stadium b, stadium c
    where (a.id=b.id-1 and a.id=c.id-2 and a.people>=100 and b.people>=100 and c.people>=100)
    or(a.id=b.id+1 and a.id=c.id-1 and a.people>=100 and b.people>=100 and c.people>=100)
    or(a.id=b.id+2 and a.id=c.id+1 and a.people>=100 and b.people>=100 and c.people>=100)
    order by date;
    '''


  • 0
    L
    This post is deleted!

Log in to reply
 

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