I am trying to make a query that looks at one table to find out if there is a student in the team called CMHT and in the medical team - if there are any, I donβt want to see the result.
I want to see only the record if they are only in CMHT or medic, and not both.
Will the correct direction use a sub-query to filter it? I did a search on NOT IN, but how could you check if it is in more than 2 commands?
Student Team ref 1 CMHT 1 1 Medic 2 2 Medic 3 this would be in the result 3 CMHT 5 this would be in the result
So far I have executed the following code: do I need to use a subquery or do a self-join and filter it this way?
SELECT Table1.Student, Table1.Team, Table1.refnumber FROM Table1 WHERE (((Table1.Team) In ('Medics','CMHT'))
source share