Re: Why using "Group By"

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Thu, 13 Mar 2003 12:18:14 -0800
Message-ID: <RN5ca.15$wV5.160_at_news.oracle.com>


"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 - 21:18:14 CET

Original text of this message