| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: does a table always need a PK?
Mikito Harakiri wrote:
>
> "Christopher Browne" <cbbrowne_at_acm.org> wrote in message
> news:bj30il$eoev7$3_at_ID-125932.news.uni-berlin.de..
> > Consider:
> >
> > select count(a + b) from table_t;
> >
> > The nature of the addition there is different from the nature of the
> > COUNT()ing. Perhaps "a + b" should be resolved by reduction of + over
> > a and b. But that's only "perhaps." If the thing inside the
> > aggregate was (a*a - b*b + 25), it is no longer obvious that it is
> > appropriate to recursively use reduction on the components.
>
> Since we can express count via sum, where
>
> select count(a + b) from table_t;
>
> becomes
>
> select sum(1) from table_t;
>
> could I suggest that "count" is redundant operator, so that we can drop it
> from consideration altogether?
You might replace count(*) with sum(1), but count(a + b) only counts tuples where (a+b) is not NULL.
-- Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)Received on Tue Sep 02 2003 - 20:08:48 CDT
![]() |
![]() |