Using 2 tables


  • 0
    T
    SELECT DISTINCT c1.seat_id
    FROM cinema c1, cinema c2
    WHERE (c1.seat_id = c2.seat_id -1 OR c1.seat_id = c2.seat_id +1)
    AND c1.free = 1 AND c2.free = 1
    ORDER BY c1.seat_id;
    

Log in to reply
 

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