Re: Questions re subqueries

  • From: Luke Davies <luke.davies@xxxxxxxxxxx>
  • To: wjwagman@xxxxxxxxxxx
  • Date: Wed, 20 Jun 2007 09:07:32 +0100

A NULL will not equate to anything not even NULL, and also a NULL will not NOT equate to anything either. So ...

select count(*) from dual
where NULL = NULL

Will get zero rows

select count(*) from dual
where NULL != NULL

Will get zero rows

Basically you will get a false result using NULLs unless you use the special syntax IS NULL or IS NOT NULL. Also DECODE will allow you to equate NULL.


The contents of this message and any attachments are confidential and are
intended for the use of the persons to whom it is addressed.
If you are not the intended recipient, you should not copy, forward, use or
alter the message in any way, nor disclose its contents to any other person.
Please notify the sender immediately and delete the e-mail from your system.
The sender is not responsible for any alterations that may have occurred without
authorisation. Any files attached to this email will have been checked by us
with virus detection software before transmission.
You should carry out your own virus checks before opening any attachments, as we
do not accept any liability for loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at

Other related posts: