| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"
"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
![]() |
![]() |