Thread: 'Not in' Query
View Single Post
  #3  
Old May 24th, 2004, 05:16 PM
Newbie
external usenet poster
 
Posts: n/a
Default 'Not in' Query

Try something like: (not tested)

SELECT StudentList.StudentID
FROM StudentList LEFT JOIN StudentClasses ON StudentList.StudentID =
StudentClasses.StudentID
WHERE StudentClasses.StudentID Is Null

HTH

"John" wrote in message
...
Hi, I have a few tables and want to run a query, but am
not sure how the sql will work out. I have a table that
has a list of students, and a results table that lists all
students and the corresponding classes they have taken
(also have a class table). What I want to do is run a
query that will show me all people who have NOT taken a
class. My results table has a list of people and classes
they have taken, and can't figure out how to run a query
that will ask the user for a class and then reference
everybody who hasn't taken that class....Any help would be
greatly appreciated.

Thanks a lot!!!