题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
--解题方案(1) selectdistincta.seat_idfromcinemaajoincinemabonabs(a.seat_id-b.seat_id) =1anda.free=trueandb.free=trueorderbya.seat_id; --解题方案(2) WITHt1AS(SELECTc1.seat_idid1, c2.seat_idid2FROMcinemac1INNERJOINcinemac2ONc1.seat_id+1=c2.seat_idANDc1.free=1ANDc2.free=1) SELECT*FROM (SELECTid1seat_idFROMt1UNIONSELECTid2FROMt1) tORDERBYseat_id