Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"
"Bob Badour" <bbadour_at_golden.net> wrote in message
news:jC5ca.63$hO2.8318076_at_mantis.golden.net...
> On a system that requires logical identity, the same query would simply
be:
>
> select max(ssal) from ( select deptno, sum(sal) as ssal from emp )
I'm not suggesting that
select max(sum(sal)) from emp
group by dept
is more consistent notation than
select max(ssal) from
( select deptno, sum(sal) as ssal from emp /*implicit GBY*/)
It is just takes less keystrokes.
If the goal is the consistent GBY notation, it would require rewriting
select sum(sal) from emp
as
select sum(sal) from emp
group by {}
or more realistically
select sum(sal) from emp
group by 1
The latter can be transformed into a NULL bait
select sum(sal) from emp
group by NULL
(it actually runs on oracle;-)
You can find confusing notation everywhere, including math. If mathematicians struggle to develop consistent notation, what would you expect from SQL folks? Received on Thu Mar 13 2003 - 14:18:14 CST