Hi everyone, great site. I've been looking around for a while, and now this is my first post. I'm having a SQL problem...any help would be great. I have a table (SCHEDULE_t) that contains teachers and the classes they teach. See below:
TEACHER CLASS
0001 MATH
0001 HISTORY
0002 HEALTH
0002 CHEMISTRY
0003 MATH
0003 HISTORY
0004 MATH
0004 GYM
Basically, I'm trying to find the teachers that teach MATH, but not GYM. In other words, 0001 and 0003 would show up, but not 0004 (he teaches MATH, but since he also teaches GYM he won't be on the list). I understand how to find the teachers that teach MATH, or the teachers that don't teach GYM, but I can't figure out how to do both.
Arg, any hints would be great!
TEACHER CLASS
0001 MATH
0001 HISTORY
0002 HEALTH
0002 CHEMISTRY
0003 MATH
0003 HISTORY
0004 MATH
0004 GYM
Basically, I'm trying to find the teachers that teach MATH, but not GYM. In other words, 0001 and 0003 would show up, but not 0004 (he teaches MATH, but since he also teaches GYM he won't be on the list). I understand how to find the teachers that teach MATH, or the teachers that don't teach GYM, but I can't figure out how to do both.
Arg, any hints would be great!