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 ('abc') vs. != 'abc'

ukraine.believeMar 7 2008 — edited Mar 7 2008
oracle 10g. we're using all uppercase.
i know using: <> is not very efficient.
but i'm surprised to see that these two where clauses return different results:
field is not null and field not in ('abc')
vs.
field not in ('abc', null)
the second statement does not return the record i'm looking for, while the 1st does!
also, when working with strings, is there a generally accepted preference between using: != 'abc' or not in ('abc') ,,, or is there another preferred operator / technic i'm forgetting?
Thanks,
mike.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2008
Added on Mar 7 2008
4 comments
311 views