Re: Null in subquery returns no records

From: Dawn M. Wolthuis <dwolt_at_tincat-group.com>
Date: Mon, 9 Feb 2004 17:13:17 -0600
Message-ID: <c0946k$69c$1_at_news.netins.net>


A null set, which I will write here as {}, is a single value, just as the set {1, 2, 7} is a single value (for an element whose values are sets). The null set itself is a set with zero elements, while the second set has 3 elements. Those numbers refer to the cardinality of the sets, however, not of the variable whose value is a single set.

Additionally, we can apply functions to these sets to extract the first element of the set, for example, if it is an ordered set, or to provide us an array or other data construct, where each of the set values can be handled individually if useful. In that case, a null set would yield an empty array.

RDBMS folks who suggest that no values should ever be NULL are effectively trying to take the painful 3-valued logic of SQL and turn it into a two-valued logic. In that case, they typically have a value somewhere that means "we don't know a value" or "there is not a value". Once you make this a value instead of a NULL in an RDBMS, you are handling the situation in a similar fashion to a 2-valued logic system, but where the value of a "no value to provide the database" has been hard-coded by the application developers.

Thanks for asking. If this, too, prompts more questions, don't hesitate to ask. --dawn Received on Tue Feb 10 2004 - 00:13:17 CET

Original text of this message