Re: So what's null then if it's not nothing?

From: Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo>
Date: Thu, 15 Dec 2005 00:03:49 +0100
Message-ID: <3r81q1d8cfefnht3bkfo97ojcd1seail77_at_4ax.com>


On Mon, 12 Dec 2005 11:08:33 +0100, Jon Heggland wrote:

(snip)
>Thanks a lot for the summary of SQL booleans, but you didn't mention the
>most interesting thing: When you check two SQL-boolean attributes for
>equality (using '=', in a WHERE clause), and both are Unknown, what is
>the result? True or Unknown?

Hi Jon,

I would personally favor a definition where UNKNOWN == UNKNOWN would yield TRUE, but NULL == NULL would be UNKNOWN. Of course, in the SQL-99 implementation that doesn't differentiate between UNKNOWN and NULL, this is not possible. <sigh>

Here's what the standard says about comparisons between "booleans":

"4.5.2 Comparison and assignment of booleans

All boolean values and SQL truth values are comparable and all are assignable to a site of type boolean. The value True is greater than the value False, and any comparison involving the null value or an Unknown truth value will return an Unknown result. The values True and False may be assigned to any site having a boolean data type; assignment of Unknown, or the null value, is subject to the nullability characteristics of the target."

Best, Hugo

-- 

(Remove _NO_ and _SPAM_ to get my e-mail address)
Received on Thu Dec 15 2005 - 00:03:49 CET

Original text of this message