Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Q getting a Percentage of a total.........?
"Mike Cohen" <mcohen_at_attbi.com> wrote in message
news:9a742dd3.0212061445.7c4c1f52_at_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
: ...
Maybe something like:
select
t2.DESC,
round(((count(t1.PURPOSE)/(SELECT COUNT(purpose) FROM t_1))*100))
Pct_Of_Total,
round((avg(t1.PRICE)),0)
from
t_1 t1,
t_2 t2
...
regards,
Damjan S. Vujnovic
University of Belgrade
School of Electrical Engineering
Department of Computer Engineering & Informatics
Belgrade, Yugoslavia
http://galeb.etf.bg.ac.yu/~damjan/
:
: 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 - 17:11:48 CST
![]() |
![]() |