Re: does a table always need a PK?
From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Wed, 3 Sep 2003 09:09:02 -0700
Message-ID: <Vuo5b.11$eu1.202_at_news.oracle.com>
Date: Wed, 3 Sep 2003 09:09:02 -0700
Message-ID: <Vuo5b.11$eu1.202_at_news.oracle.com>
"Lee Fesperman" <firstsql_at_ix.netcom.com> wrote in message
news:3F559DC5.7E91_at_ix.netcom.com...
> Mikito Harakiri wrote:
> > AVG = SUM(val)/SUM(1) is redundant
>
> That's ugly. And, it is incorrect. I see no problem with shorthands like
AVG().
Ugly or not, that's a mathematical definition of what AVG is. Make it AVG =
SUM(val)/COUNT(1), if you want to correct it for nulls. If the definition
doesn't work for extreme cases like zero rows, it also means that it should
be redefined to suit those, as they routinly do in math.
Received on Wed Sep 03 2003 - 18:09:02 CEST