Here is one way (notice how the sample data is in a consumable format):-- Setup Sample DataDECLARE @People TABLE (PersonID INT, PersonName VARCHAR(20), DeptID VARCHAR(20))INSERT @People VALUES(201, 'Fred', '32A'),(209, 'Julie', '25C'),(255, 'Jane', '19F'),(262, 'John', '55R')DECLARE @Courses TABLE (CourseID INT, CourseName VARCHAR(20))INSERT @Courses VALUES(1, 'Course1'),(2, 'Course2'),(3, 'Course3'),(4, 'Course4'),(5, 'Course5')DECLARE @PeopleCourses TABLE (PersonID INT, CourseID INT)INSERT @PeopleCourses VALUES(209, 1),(209, 2),(209, 5),(255, 1),(255, 3),(262, 1),(262, 5)-- Return resultsSELECT *FROM ( SELECT * FROM @People AS People CROSS JOIN @Courses AS Courses WHERE People.DeptID IN ('32A', '19F') AND Courses.CourseName IN ('Course1', 'Course5') ) AS PLEFT OUTER JOIN @PeopleCourses AS PeopleCourses ON P.PersonID = PeopleCourses.PersonID AND P.CourseID = PeopleCourses.CourseIDWHERE PeopleCourses.PersonID IS NULL