SELECT subjects.name as name , grades.grade as grade, concat(instructors.lastname, ", ", instructors.firstname , " ", left(instructors.middlename, 1),".") as instructor
FROM subjects
JOIN grades
JOIN instructors
WHERE grades.student_id = 1 AND subjects.id = grades.subject_id AND instructors.subject_id = subjects.id
结果是
English Instructor Grade
Math Instructor Grade
但我想要的是在还没有教师的科目中给出“N/A”。例子
English Instructor Grade
Math Instructor Grade
Science N/A Grade
History N/A Grade
我将如何在 mySQL 中设置条件,以便结果与上面的示例完全相同?
提前致谢