CXZ7720 / Join-Join

2018-2 Database PBL Project Repository
1 stars 4 forks source link

mod reservation date query #29

Closed onnoo closed 5 years ago

onnoo commented 5 years ago

remove duplicated select and use group by for select one room number in possible grade.

query : SELECT grade, room_number FROM Room WHERE room_number NOT IN (SELECT distinct room_number FROM Reservation WHERE check_in >= DATE('${check_in}') AND check_out <= DATE('${check_out}')) GROUP BY grade;