Why my code doesn't work?(three union wouldn't work but any of the two combination works)


  • 0
    U

    '''
    SELECT s1.*
    FROM stadium s1 left join stadium s2 on (s1.id = s2.id-1) left join stadium s3 on (s1.id = s3.id-2)
    WHERE s1.people>100 and s2.people>100 and s3.people>100
    UNION
    SELECT s2.*
    FROM stadium s1 left join stadium s2 on (s1.id = s2.id-1) left join stadium s3 on (s1.id = s3.id-2)
    WHERE s1.people>100 and s2.people>100 and s3.people>100
    UNION
    SELECT s3.*
    FROM stadium s1 left join stadium s2 on (s1.id = s2.id-1) left join stadium s3 on (s1.id = s3.id-2)
    WHERE s1.people>100 and s2.people>100 and s3.people>100

    '''


Log in to reply
 

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