Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL-statement

Re: SQL-statement

From: Isa <isapmon_at_terra.es>
Date: 1 Sep 2005 02:42:36 -0700
Message-ID: <1125567756.083071.226540@g43g2000cwa.googlegroups.com>


Hi:
If I have understood ok, your table has the next values:

Lines Qty
-------- --- -

1        4
2        4
5        2

You can do the next:

select lines,qty,qty*100/(select sum(qty) from table) percent,

          (select sum(qty*100/(select sum(qty) from table))
           from table i2 where i2.lines<=table.lines) accumulated
from table
order by lines;

I hope it's usefull to you.
Regards,
Isa Received on Thu Sep 01 2005 - 04:42:36 CDT

Original text of this message

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