Oracle and the NULL Concept

While reviewing a query at the end of the day that was using a check for the non-existence of a value, found something was amiss. That woke me up. It so happened that the query involved checking that a attribute does not have a particular value. For instance:

select * from ABC where col1 != ‘some_value';’

‘ABC’ had col1 as a NULLABLE column and that implies that it can have null values. Now, what would this query do? It would not return any of the tuples/rows that had col1 as NULL. Why?

The reason lies in understanding the meaning of NULL. In this context, NULL implies that the value is unknown and not that the value does not exist or is absent.

For more details, please refer to this link.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">