SELECT C_id FROM appointment WHERE S_id LIKE '%DR%' AND C_id NOT EXISTS IN( SELECT C_id FROM appointment WHERE S_id LIKE '%HW%' AND S_id LIKE '%SW%') I'm trying to select the Customer ID who used the service DR but not other service HW and SW.