Thanks PHV. It works. I guess that if iI have also a C column and I desire to get a D column
as C/AVG(C) I should query
select A
, A / (select avg(A) from (Select .....) CALC) as B
, C / (select avg(C) from (Select .....) CALC) as D
from
(Select .....) CALC
Probably creating...
Well...just a little bit further... :)
The CALC table I was talking about is actually the result
of a quite complex query.
I've just tried this:
select A
, A / (select avg(A) from CALC) as B
from
(Select .....) CALC
Oracle highlights the CALC in (select avg(A) from CALC)
and tells...
Well I just checked with access,
select A, avg(A) as B from CALC group by A
A MedA
1 1
4 4
5 5
34 34
53 53
99 99
doesn't seem to work....
When i group by A then AVG(A) = A ....
Hi rudy...thanks for your tip...
if I have also a C column and I desire to get a D column
as C/AVG(C) I should query
select A,(A/avg(A)) as B, C, (C/avg(C)) as D group by A,C ???
I don't have Oracle at home...just my curiosity till monday
morning! :)
I have the numeric field A in Table CALC.
I would like to add a column B in which each
value is A/AVG(A).....
A B
0.91 1.005079717
0.48 0.528822191
1.37 1.50921702
1.02 1.122162345
0.86 0.954474088
0.35 0.385052138
0.88 0.967094062
1.17 1.288388365
1.12 1.239710074
Thanks for your help!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.