Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"

Re: Why using "Group By"

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Mon, 17 Mar 2003 17:40:38 -0800
Message-ID: <9Uuda.22$NS1.174@news.oracle.com>


"oferbu" <junkbu_at_hotmail.com> wrote in message news:b9b409f2.0303162232.cd259fe_at_posting.google.com...
> So if I sum all the replies by now, there is no really any need for
> the extra information added by the clause "Group by YYY, ZZZ" when the
> SQL already contains an aggregate function, right?

Correct: nobody, suggested a reason convincing enough to justify "group by". Even in complicated examples like this

select power(2,floor(log(2,sal))) || '-->' || power(2,floor(log(2,sal))+1)

     , count(1)
from emp
group by floor(log(2,sal))

the equivalent query is

select power(2,floor(log(2,sal))) || '-->' || power(2,floor(log(2,sal))+1)

     , count(1)
from emp
group by power(2,floor(log(2,sal))) || '-->' || power(2,floor(log(2,sal))+1)

and, therefore, "group by" is redundant. Received on Mon Mar 17 2003 - 19:40:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US