Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> SOLVED: Difference between NOT IN and MINUS
I posted the message a few hours ago. The problem turned out to be a missing
null check inside the subquery:
SQL> select asset_id from easset where asset_id not in (select asset_id from table_object where asset_id is not null);
ASSET_ID
4186 4843 5050 5180 5253 5209 5212 5240 5242 5243
which is the same result as using MINUS between two subqueries (unless there're duplicates). Without "where asset_id is not null" in this subquery, it returns no rows. The table table_object has some null's in the asset_id column.
I know Oracle has a lot of idiosyncrasy in dealing with nulls. But I didn't expect this one.
Yong Huang
yong321_at_yahoo.com
![]() |
![]() |