Re: Celko: help with an experiment

From: Steve Kass <skass_at_drew.edu>
Date: Tue, 09 Jul 2002 18:19:02 -0400
Message-ID: <3D2B6155.AEEBB27A_at_drew.edu>


The SQL-92 standard says nothing about grouping on a phantom column. It defines a grouped table as the result of a group by clause or a having clause, neither of which is allowed to be invisible. If you are going to insist on this hokus-pokus phantom column garbage, tell me where it is in the standard. Oh, I get it now, it's in the phantom paragraph of the standard that only you can see. (Maybe I don't have the final copy of the standard?)

In the absence of a grouped table, there are two cases. 1) One row is returned if there is a set function expression referring to a column of the table. Not the case here. 2) The result contains a row for every row of the table. That's what we have here, I believe.

Steve

--CELKO-- wrote:

> >> One question I still have on this issue is when the aggregate
> does not
> refer to any columns of the table, as in
>
> select max(12) as Twelve from T;
>
> for different cardinalities of T. My best try at the SQL-92 standard
> suggests
> this should return as many rows as there are rows in T. I don't have
> a copy
> of the 99 standard to try to decipher its verdict. <<
>
> I would say that we build a table of (n) rows with the expression 12
> in all of them, then group on the phantom column and return one row
> with 12 in it. If I just wrote:
>
> select 12 as Twelve from T;
>
> then i woudl get (n) rows each with 12 in them.
Received on Wed Jul 10 2002 - 00:19:02 CEST

Original text of this message