Not query

  • Thread starter Thread starter Andrea
  • Start date Start date
A

Andrea

I have a database that tracks students and there courses.
What I want to do is create a query that when run shows a
list of names for all students that have not taken a
class. Every combination i try seems to give me nothing
correct....I have a Training table that charts information
for the class, a COURSE table that has further defined
attributes of the class (section number, meeting times
etc...) a RESULTS table that gives the student name and
all results and a PROFILE table that keeps general
information of the student. any help would be greatly
appreciated. thank you!!!!!!!!!!!!!!!!!!!!!!!
 
You need to do a SELECT from the main Student table (which
I think is PROFILE) WHERE the Student primary key is not in
the Class table (which I think is TRAINING). It would be
something like
SELECT * FROM Profile WHERE studentId NOT IN (SELECT
DISTINCT studentId FROM Training)

Hope This Helps
Gerald Stanley MCSD
 
Back
Top