Re: Why using "Group By"
Date: 19 Mar 2003 06:43:50 -0800
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