I only have a month of learning experience on sql server and I was just wondering why the first query before produces the right results (i.e. join two table and only select rows from left table that does NOT have a matching row), whereas the second query returns an empty query.
First
select R.Name, A.Name
from tblResident as R
left join tblApartment as A
on R.ApartmentID = A.ID
where R.ApartmentID is null
Second
select R.Name, A.Name
from tblResident as R
left join tblApartment as A
on R.ApartmentID = A.ID
where R.ApartmentID = null
Table structure