Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NOT IN with multiple columns and nulls

sKrAug 17 2016 — edited Aug 17 2016

Hi all.

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

PL/SQL Release 10.2.0.4.0 - Production                         

CORE 10.2.0.4.0 Production                                       

TNS for Linux: Version 10.2.0.4.0 - Production                 

NLSRTL Version 10.2.0.4.0 - Production

I am working with NOT IN and comparing against multiple columns, I know that when there is a NULL value returned by the sub-select the entire set is evaluated to false but in this case when I have tow columns and only the second column is null I get the rows returned, for example:

select 'true' from dual where (1,2) not in (SELECT null,2 FROM dual);

no rows selected

select 'true' from dual where (1,2) not in (SELECT 2,null FROM dual);

'TRU

----

true

Could somebody please explain to me why this happen?

Thanks in advance, regards.

This post has been answered by Frank Kulash on Aug 17 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2016
Added on Aug 17 2016
6 comments
3,641 views