| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Aggregation (with GBY) is Relational Division
"Marshall" <marshall.spight_at_gmail.com> wrote in message
> Actually, I had kind of a jolt reading something Bob Badour
> wrote recently about defining aggregates as either a fold
> or an expression written in terms of folds. (He did not use
> the term "fold".) Thus, avg(x) can be defined as simply
> sum(x) / count().
I disagree. avg(x) can be defined as simply sum(x) / count(x).
This may seem like nitpicking. I think it's reasonably important.
If you do select avg(x), sum(x)/count(*), sum(x)/count(x) from some_view
you are going to get a difference when there are rows in the view that contain NULL in the x column. Try it and see.
This relates to a comment about managing missing data in SQL that I didn't take very much to heart.
PS: can you point me to a web site that will explain "fold" to me? Received on Mon Jun 05 2006 - 11:24:02 CDT
![]() |
![]() |