Hello,
I am trying to get list of students who don't have sibling in one building.
Below is my query.
When I take out the Not in the Not In statement I get data to return. It gives me the list of students that have siblings in the other building. I would like the opposite.
I am just learning to SQL queries at the beginners stage.
Thank you for your help.
Jeremy
SELECT
s.LASTFIRST,
s.FAMILY_IDENT,
s.SCHOOLID
FROM Students s
WHERE ( s.ENROLL_STATUS = 0
AND s.schoolID IN (2,3,4)
AND s.FAMILY_IDENT Not IN ( SELECT DISTINCT s.Family_Ident
From Students s
WHERE S.SchoolId = 2
)
)
ORDER BY
s.LASTFIRST