Skip to content
Advertisement

Display the data that does not exist in particular table using multiple interconnecting table join

I am trying to list all students that did not enroll in this subject yet using the var_subjectcode as filter. I am using the code below but it is not working properly. It keeps on resulting empty string.

If I excluded the AND a.number is NULL in the whole query it returns the list of students who enrolled in that particular var_subjectcode. What I wanted is the opposite. If I put value in the var_subjectcode it should return the list of students who are not enrolled in that var_subjectcode.

var_subjectcode is in the E Table.

Is there a better way to get my desired result?

Advertisement

Answer

if you want list of student who not participated in the given subject code, here is qhat you need also simplified:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement