General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Select from where not in query fails when there are nulls
Regarding the query below, the value "A&P" is not in the acctnrlu table (in the luacctnm column). A&P is in curdata. So the query should return rows. However, it wasn't returning anything. There was one row with a null in acctnrlu.luacctnm. I didn't think this should matter. Yet when I removed the row with the null, the query began working. Is this the expected behavior?
SELECT accountnam FROM curdata WHERE accountnam NOT in (SELECT luacctnm FROM acctnrlu)
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only