Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Q getting a Percentage of a total.........?
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
![]() |
![]() |