FROM TherapistDegree AS td, Degree AS d, School AS s
WHERE td.schoolId = s.schoolId AND td.degreeId = d.degreeId AND td.therapistId IN( $tIds )
ORDER BY dYear DESC, degree ASC
Everything works fine except for those pesky therapists who only enter their degree and no school. without a school Id in TherapistDegree, no degree will display at all, even if it is there. How can I modify this query to allow users to leave td.schoolId blank and still see their degree?
SELECT td.therapistId, td.tdId, td.dYear, s.school, d.degree
FROM TherapistDegree AS td
LEFT OUTER JOIN Degree AS d ON td.degreeId = d.degreeId
LEFT OUTER JOIN School AS s ON td.schoolId = s.schoolId
WHERE td.therapistId IN( $tIds )
ORDER BY dYear DESC, degree ASC
This way if they forget to enter their school and/or degree they will still be listed.
Bookmarks