On 17 Sep 2012, at 3:50pm, "Black, Michael (IS)" <[email protected]> wrote:
> I'll note that Oracle doesn't count ''. whereas sqlite3 does. Does the SQL
> standard say anything about what a "NULL" value is? And who's correct here
> if there is a standard?
I believe that the values are fine. The problem in SQL92 is that it doesn't
define what 'count()' means in terms of values, just objects. Skipping over a
number of different uses for count(), the definition wanted here is
"cardinality (of a collection): The number of objects in that
collection. Those objects need not necessarily have distinct
values."
So the question becomes whether NULL is an object or not. Unfortunately the
standard says
"A special value, or mark, that is used to
indicate the absence of any data value."
It is clear that NULL is used to indicate the lack of a data value.
Unfortunately I'm having trouble figuring out whether NULL is an object, or is
used to indicate the lack of an object. I suspect that this is what leads to
different SQL engines implementing count() in different ways.
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users