Oracle “Not In” Clause Confusion

“NOT IN” clause is not the opposite of “IN” clause. Because NULL rows can cause confusion.

In order to solve the problem convert NULL values to 0 by using:

select * from mytable where NVL(userid,'0') not in ('4','7','15')
Advertisements