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_at_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 Tue Mar 18 2003 - 02:40:38 CET

Original text of this message