Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?

Re: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?

From: Jan Hidders <jan.hidders_at_REMOVE.THIS.ua.ac.be>
Date: 12 Mar 2003 00:04:53 +0100
Message-ID: <3e6e6b95.0@news.ruca.ua.ac.be>


Mikito Harakiri wrote:
>"Jan Hidders" <jan.hidders_at_REMOVE.THIS.ua.ac.be> wrote in message
>news:3e6e57e3.0_at_news.ruca.ua.ac.be...
> What I meant was:
>>
>> >> SELECT f(x)
>> >> FROM
>> >> ( SELECT g(y)
>> >> FROM y IN Y ) AS x
>>
>> and
>>
>> >> SELECT f(g(y))
>> >> FROM Y AS y
>
>In set model
>
>SELECT f(x) as Fx, y
>FROM
> ( SELECT g(y) as x, y
> FROM Y)
>
>reduces to
>
>SELECT f(g(y)) as FGy, y
>FROM Y
Absolutely. However, that rule doesn't apply because aggregation functions are used and a group by is included. Just for clarity here is the reduction that you have to derive, in a more proper notation:

  SELECT f(x) AS fx, COUNT(*) AS cnt
  FROM
    ( SELECT g(y) AS fy, COUNT(*) AS cnt

      FROM Y AS y
      GROUP BY fy ) AS x

  GROUP BY fx

to

  SELECT f(g(y)) AS fx, COUNT(*) AS cnt
  FROM Y AS y
  GROUP BY fx

Received on Tue Mar 11 2003 - 17:04:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US