| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"
"Mikito Harakiri" <mikharakiri_at_ywho.com> wrote in message
news:3i4ca.10$wV5.124_at_news.oracle.com...
> > select max(sum(sal)) from emp
> >
> > is not the same as
> >
> > select max(sum(sal)) from emp
> > group by dept
>
> Trivially so, because second query won't run. Please ignore this message.
The observation is valid. Please ignore my "ignore" reply. select max(sum(sal)) from emp
group by deptno
The query uses inner agregate function together with group by, and then applies outer aggregate function. It could be expressed as
select max(ssal) from (
select sum(sal) as ssal from emp
group by deptno
)
of course. Received on Thu Mar 13 2003 - 12:43:50 CST
![]() |
![]() |