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 -> Q getting a Percentage of a total.........?

Q getting a Percentage of a total.........?

From: Mike Cohen <mcohen_at_attbi.com>
Date: 6 Dec 2002 14:45:15 -0800
Message-ID: <9a742dd3.0212061445.7c4c1f52@posting.google.com>


Hello Everyone,

I've been banging my head with this problem and was hoping someone here could help out.

I have the following query:

select
t2.DESC,
round(((count(t1.PURPOSE)/18175)*100) ) Pct_Of_Total, round((avg(t1.PRICE)),0)
from
t_1 t1,
t_2 t2
...

The problem I'm having is that I want where I have 18175 in my select to be a full count of t1.PURPOSE - sum of all the counts if you will. The number 18175 is the full count, yet I don't want it hardcoded in. I've tried:

*sum(count(t1.purpose)) but this bombs on Group By errors...
*searching OTN as well as various manuals...
*searching the google archives...

all with no real success.

Does anyone have any ideas?

Thanks in advance...

Mike Received on Fri Dec 06 2002 - 16:45:15 CST

Original text of this message

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