'Why would a Select from Tabke1 where FIeldA not in (Select FieldA from Table2) fail if I manually confirm it should work?

I ran

Select Term from TableA where Term not in (Select Name from TableB)

successfully. Yet when I tried another table

Select Term from TableA where Term not in (Select Name from TableC)

It returns a NULL set. I manuallyt confirmed there are literaly 1000s of records in TableA not in TableB and that the fields are correct.

Is there some other consideration I am not taking into account/understanding about what seems to be a simply query?

Update: Interestingly enough this alternative query worked:

 Select Term from TableA where not exist (Select Name from TableB where TableA.Term=TableC.Name)

So while I solved the problem at hand I am still curious why the first query worked for both tables but only the second worked on TableC



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source