I had this question after viewing Need Distinct Value from Joined Tables in MSSQL
With this SQL query, I am trying to match the faculty members with their topics. The user is presented with a dropdown of Research Topics, When selected, the user should be presented with a list of faculty members who are working in research on those topics.
SELECT First_Name, Last_Name, Department_Name, suapp.FACULTY.Faculty_UUID, Faculty_Email, Faculty_Title, Faculty_Profile_Link FROM suapp.FACULTY
JOIN (SELECT DISTINCT
WHERE suapp.RESEARCH_MATCH.Area_Topic_Code = suapp.AREA_TOPIC.Area_Topic_Code
AND suapp.AREA_TOPIC.Area_Topic_Code = 'CD-a'
) rm ON suapp.FACULTY.Faculty_UUID = rm.Faculty_UUID ORDER BY suapp.FACULTY.Last_Name, suapp.FACULTY.First_Name;
An expression of non-boolean type specified in a context where a condition is expected, near 'WHERE'.
Thank you for any help in this situation.