| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"
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
![]() |
![]() |