Re: Examples of SQL anomalies?

From: David Cressey <>
Date: Thu, 03 Jul 2008 13:32:01 GMT
Message-ID: <lx4bk.134$Z11.36_at_trndny05>

"Philipp Post" <> wrote in message On 2 Jul., 20:39, "David Cressey" <> wrote:
> >b) SUM{1, NULL, 1} = 2, however I could just say that the result is AT
> >LEAST 2 but the function cannot state it that precisely and as such it
> >would make more sense if it would then throw an error like "You cannot
> >apply this function on data containing NULL" what would force the
> >developer to SELECT SUM(SomeAmount) .... WHERE NOT SomeAmount IS NULL.
> >If this would make SQL programming more fun is a different question...
> I disagree. If NULL meant "there is a value for this entry, but we don't
> know what it is" then your interpretation might be correct. However, if
> NULL means "there is no value for this entry" then excluding it from
> consideration is the only sensible approach.

"You are right. I get more and more the impression, that all the confusion starts at the definition what NULL actually means. It could be

  • not known = there should be a value lateron
  • not applicable = I can omit it
  • confused with an amount of zero (0) = a mistake, if I mean zero (0) I should use it. "

Unfortunately the SQL standard propagates this confusion instead of resolving it. Received on Thu Jul 03 2008 - 15:32:01 CEST

Original text of this message