SELECT * FROM zroom WHERE (title_eng='Double Room' OR title_eng='Small Family Suite' OR title_eng='Single Room' OR title_eng='Deluxe Suite') AND hotel_id=63; SELECT * FROM zroom WHERE title_eng='Double Room' OR title_eng='Small Family Suite' OR title_eng='Single Room' OR title_eng='Deluxe Suite' AND hotel_id=63;
若是想要where條件語句後面同時使用and和or邏輯,那麼必須將or的使用小括號括住,再用and與另外一個條件組合.sql
第二條語句中and條件是不生效的,不起做用的。ide