sql - Help with query -
i'm trying make query looks @ single table see if student in team called cmht , in medic team - if don't want see result.
i want see record if they're in cmht or medic, not both.
would right direction using sub query filter out? i've done search on not in how see check if in more 2 teams not?
student team ref 1 cmht 1 1 medic 2 2 medic 3 in result 3 cmht 5 in result
so far i've done following code need use sub query or self join , filter way?
select table1.student, table1.team, table1.refnumber table1 (((table1.team) in ('medics','cmht'))
this mark byers's answer having clause instead of subquery:
select student, team, ref table1 group student having count(student) = 1
Comments
Post a Comment