Re: Oracle Reports 2.5 - Sort on Sum

From: Peter Rak <po080016_at_pop.ke.sanet.sk>
Date: 1996/07/31
Message-ID: <31FF84DB.3B32_at_pop.ke.sanet.sk>#1/1


Krustina wrote:
>
> Hello everyone,
>
> I am writing a break report in which I would like to order the break column by
> a total that is summed over the break group. The only way I can think of to
> do this is to somehow include the sum in the query, but that screws up the
> results. Any ideas?
>
> (A graphical representation may explain better:)
>
> Col1 Col2
> ---- ----
> AAA 1
> 8
> ----
> 9 (I want to order by this value, i.e., 9>3, AAA comes first)
>
> BBB 1
> 1
> 1
> ----
> 3
>
> Thanks for playing,
> Christine
>
> ****************************************************************************
> Birth... School... Work... Death...
> ^
>

Hi,

My second solution, try if it will be good.

Table xx(x number, y number);

select a.x,y,z from xx a,
  (select x,sum(y) z from xx group by x) b where a.x=b.x
order by 3;

In report don't print z column.

Please, remail after trying.

                Good luck, Peter. Received on Wed Jul 31 1996 - 00:00:00 CEST

Original text of this message