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_at_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 - 15:43:50 CET

Original text of this message