Although i can only guess what you want to achieve, i decided to post my answer to clarify what you're doing wrong.
As
Kornfeld Eliyahu Peter[
^] mentioned, you should use JOINs instead of joining table via WHERE stetement. See this great article:
Visual Representation of SQL Joins[
^]. Remeber, there are few ways to join data. Choose proper one, depending on your needs.
Your
CASE[
^] statement is written incorrectly. To make it working, the
SELECT
statement must operate on some recordset. In your case, the query will return nothing. The proper
SELECT P.KeySubjectElective, CASE WHEN P.Elective='True' THEN 'Look in Electives table' ELSE '' END AS CaseFieldOne,
CASE WHEN P.Subject='True' THEN 'Look in Subjects table!' END AS CaseFieldTwo
FROM Prospects P
Finally, i'd suggest to use
UNION[
^] statement:
SELECT S.Key_Subject, S.Subject_Name
FROM Subjects S (CROSS|INNER|LEFT|RIGHT) JOIN Electives E ON S.Key_Subject=E.Key_Subject
(CROSS|INNER|LEFT|RIGHT) JOIN Prospects P ON P.KeySubjectElective=E.KeyElective_Group and E.KeyElective_Group=2
WHERE P.Elective='True'
UNION ALL
SELECT S.Key_Subject, S.Subject_Name
FROM Subjects S (CROSS|INNER|LEFT|RIGHT) JOIN Prospects P ON S.Key_Subject=P.KeySubjectElective
WHERE P.Subject='True'