SELECT * from Table1 where ID = '11927254'
Returns one Row.
Select * from Table2 where ID = '11927254'
That returns nothing.
SELECT * from Table1 where ID NOT IN (SELECT ID FROM Table2)
And I was surpised to find out that this doesnt return anything, not even the row from Table1 with ID '11927254'. I discoverd that some rows in Table2 have a null ID, and because of this, this query was not returning the row. But I assumed that even if the Table2's ID was null, the clause "NOT IN (SELECt ID FROM Table2)" would still pass but apparently not. When it runs into a null value, the whole query doesnt work and returns nothing
So I am a bit confused about null values and why you can't compare a real value to a null value. Anyone want to take a stab at this?
Returns one Row.
Select * from Table2 where ID = '11927254'
That returns nothing.
SELECT * from Table1 where ID NOT IN (SELECT ID FROM Table2)
And I was surpised to find out that this doesnt return anything, not even the row from Table1 with ID '11927254'. I discoverd that some rows in Table2 have a null ID, and because of this, this query was not returning the row. But I assumed that even if the Table2's ID was null, the clause "NOT IN (SELECt ID FROM Table2)" would still pass but apparently not. When it runs into a null value, the whole query doesnt work and returns nothing
So I am a bit confused about null values and why you can't compare a real value to a null value. Anyone want to take a stab at this?
