The big thing to keep in mind when working with nulls is that NULL does
not mean that there is nothing in the field. NULL means that the
database does not know what is in the field. So, the only way to base a
selection on whether or not a field is NULL is to use the ISNULL()
function. Also, no comparison with NULL will ever return true. A query
like "SELECT * FROM SomeTable WHERE NULL = NULL" will return no records.
Since the database does not know what is in a NULL-valued field, it
cannot be confident that one such field is equal to another, and since
it's not confident, it has to return false.
In response to
pgsql-novice by date
|Next:||From: Thom Brown||Date: 2010-06-30 12:41:45|
|Subject: Re: null vs empty string|
|Previous:||From: Kent Thomas||Date: 2010-06-30 12:21:54|
|Subject: null vs empty string|