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!

Interesting NULL behaviour

3018678Apr 22 2016 — edited Apr 22 2016

Hi All,

When I execute the below code I expect he whole data set return but no rows return. Because NULL does not equal or nonequal to any value even NULL is not equal or nonequal to NULL, right? If so this can be overlooked, I mean user might expect NULL values can be returned if compare any string to column which contains a NULL data.

a as (

   select 1 id, '' name from dual

   union all

   select 2, '' from dual

   union all

   select 3, '' from dual

   union all

   select 4, '' from dual

select * from a where name != 'abc';

Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2016
Added on Apr 22 2016
26 comments
7,433 views