I have a long piece of PL/SQL which is working well except for one small part of the where clause.
I'm expecting that one row should be returned but, because the fields the where clause checks are null, the row is not being returned despite meeting the criteria.
I read a very good note here :
http://jonathanlewis.wordpress.com/2007/02/25/not-in/
It explains how Nulls affect NOT IN statements and I presume it's the same for NOT LIKE as well.
What I haven't been able to find is the comparable replacement I need. Do I need to somehow switch this into an IN and LIKE or provide something to return the row if NUll?
Here is a simplified version of my code.
SELECT * FROM Temp_Table T
WHERE -- Other where constraints
AND (T.Col_One NOT LIKE 'AString'
OR T.Col_Two NOT IN ('BString','CString'))
In my situation the row would have nulls in both Col_One and Col_Two.
Any help is greatly appreciated.
Thanks.