I have a table of students. and a table of teachers.
SOME of the students (not all) will have a teacher assigned to them. this is controlled in a 3rd table, matching those students with their teachers, via the studentID and teacherID
what i need the SQL to do, is to LEFT OUTER JOIN onto the 3rd table, which is then INNER JOINED onto the teacher's table (because not all students will appear in the 3rd table, but any teacher that appears in the 3rd table WILL appear in the teachers table).
i am looking to get a result of all student names, and teacher's name, where they are assigned (and null if not).
what i have so far looks like this, and it basically operates as a full INNER JOIN, and does not give me students who do not have teachers assigned:
SELECT firstname, teacherlastName
FROM tblstudents
left outer join [tblStudentRakazot]
ON tblstudents.studentid = [tblStudentRakazot].studentID
INNER JOIN tblteachers
ON [tblStudentRakazot].teacherid = tblteachers.teacherID
can someone pls give me a pointer here? i tried with placing brackets, but that didn't see, to help.
thanks!