Hi, I need a small help with one my query.I have a query:SELECT People.Name, People.Surname, Course.CourseName, Studyplan.yearFROM Studyplan INNER JOIN Course ON Studyplan.coursecode= course.code INNER JOIN People ON Studyplan.studentLogin = People.LoginWHERE (Lide.login = 'xxx') and StudijniPlan.rok = '2009'
This query returns the name of the student and the list of courses that this student have in the year 2009.Now I would like to have a list of remaining courses that this student do not have in the year 2009.I tried something like that:SELECT Course.*FROM CourseWHERE NOT Exists (SELECT Course.*FROM Studyplan INNER JOIN Course ON Studyplan.coursecode= course.code INNER JOIN People ON Studyplan.studentLogin = People.LoginWHERE (People.login = 'xxx') and Studyplan.year= '2009')
But it´s not working. Could anybody help me to fix it please? Thank you