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: Why using "Group By"

Re: Why using "Group By"

From: Tony <andrewst_at_onetel.net.uk>
Date: 19 Mar 2003 06:43:50 -0800
Message-ID: <c0e3f26e.0303190643.518a16a0@posting.google.com>


pkl_at_mailme.dk (Peter Koch Larsen) wrote in message news:<61c84197.0303190224.4ed81d12_at_posting.google.com>...
> This is not legal SQL but wouldn't it be nice to have something like:
>
> select person.name, person.income/(sum (person.income) group by
> person.division) from person?
>
> The intention is for each person to detect how large a relative salary
> he earns within each division.

Oracle has analytic queries to do that (totally non-ANSI I'm sure!):

select person.name, person.income/(sum (person.income) over (partition by person.division)) from person; Received on Wed Mar 19 2003 - 08:43:50 CST

Original text of this message

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