sougata666
Registered User.
- Local time
- Yesterday, 21:35
- Joined
- May 1, 2016
- Messages
- 36
Code:
(SELECT Aviator.Prefix, Aviator.Number, Aviator.DateOfSeniority, Year([DateofSeniority])
FROM (Aviator INNER JOIN AviatorCourse ON Aviator.ID = AviatorCourse.AviatorID)
WHERE (((AviatorCourse.CourseName)=9) AND ((Year([DateofSeniority]))=2007))))
LEFT JOIN
(SELECT Aviator.Prefix, Aviator.Number, Aviator.DateOfSeniority, Year([DateofSeniority])
FROM (Aviator INNER JOIN AviatorCourse ON Aviator.ID = AviatorCourse.AviatorID)
WHERE ((Year([DateofSeniority]))=2007))
ON Aviator.ID=AviatorCourse.AviatorID;
I am getting a syntax error. I am basically trying to find IDs of people who belong to 2007 batch but have not undertaken a particular course (denoted by index 9, i.e. set of (A-B) where A=set of people in 2007 batch and B=set of people in 2007 batch who have undertaken the course.)
Where am I going wrong & can I simplify the code?
I read that INNER JOIN cannot be inside LEFT JOIN.
Also, there are multiple courses against each person so I have to take this roundabout route to get my answer.
Last edited: