> There he clearly stated that NULL is a data type with only one value named NULL.

As I said this is a matter of definition.
You can go ahead and define a type with name NULL that has only one value which is NULL.

But step aside for a second to a world where the concept of null was still not existing. Wouldn't you wonder why someone invented such a meaningless type and meaningless value?

> NULL is NOT equal to nothing because the null value is an irregularity in any other data type
> that only express or mean the absence of a known value.

So do you mean that null is unequal to everything?
Even unequal to itself.
Then statements like
COL1 = COL1, which would seem to always evaluate to true, could infact evaluate to false
(when variable COL1 has NULL as value).

> null value is an irregularity in any other data type

I can not figure out what this sentence could possibly mean.

> that only express or mean the absence of a known value

So if null means that a value is missing then it clearly is a metavalue.
Value talking about the values.
And thus I feel understanding toward the position that NULL IS NOT A VALUE like the other values in the database.

> UNKNOWN is a descriptive term used for a NULL value in the evaluation of an expression of boolean type.

That sentence can not possibly mean anything.

Here the first paragraph from Wikipedia article Null (SQL)
Heading: History
"Null was introduced by E. F. Codd as a method of representing missing data in the relational model <http://en.wikipedia.org/wiki/Relational_model>. Codd later reinforced his requirement that all RDBMS' support Null to indicate missing data in a two-part series published in /ComputerWorld/ magazine.^[1] <http://en.wikipedia.org/wiki/Null_%28SQL%29#cite_note-0> ^[2] <http://en.wikipedia.org/wiki/Null_%28SQL%29#cite_note-1> Codd also introduced a ternary (three-valued) <http://en.wikipedia.org/wiki/Ternary_logic> logic, consisting of the truth values <http://en.wikipedia.org/wiki/Truth_value> True, False, and Unknown, which is closely tied to the concept of Null. The Unknown truth value is generated whenever Null is compared with any data value, or with another Null."

> So, in sql the boolean data type have only two values TRUE and FALSE OR don't have any value at all.

Where do you get your information ?!?

> In any context where a expression must to be evaluated for a boolean result ( for example in a where clause) > if any operand is null then the expresion value is UNKNOWN having no effect in their context.

What does "having no effect in their context"?
Does it mean that the sql statement is silently ignored?
That's what having no effect could mean.

So you say that a boolean expression evaluates to UNKNOWN, yet UNKNOWN is just a descriptive term for NULL.
Why not just say that boolean expression can evaluate to value NULL.
But since NULL is not of boolean type but of type NULL (according to your sources) then the boolean expression like COL1 = COL2 can evaluate to null so the expression does not have ONE but TWO possible types: Boolean and Null. (So we need to evaluate the type of the expression at runtime, like in javascript).

> NULL isn't comparable, but every implementation has the choice (or setup) of an ordering convention for null values as FIRST or LAST values.

But in a where clause you must produce some kind of decision.

WHERE NULL > 1

So what does the where-clause do?
Does it include the row?
Does it exclude it?
Does it just get stuck and freeze?
Having a rather severe effect on the execution of the application.

- Rami

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to