hey i have a table with two columns like
col1 col2
---- ----
1 2
1 2
1 4
2 5
2 8
3 7
2 8
4 6
2 5
3 7
what i wanna do is to
firstly calculate the mean of values of col2 on basis of col1 (grouped by col1). so i get a average for eeach of 1,2,3 and 4 from col1.
and then i wanna get the sum of those averages.
when i do
select sum(col2)/count(col2) from tablename group by col1;
i get all the averages collectly.
WHAT I NEED IS THE SUM OF THESE AVERAGES.
so i do
select sum(sum(col2)/count(col2)) from tablename group by col1;
but that gives error. whats the issue ??????? and how to get value desired ????
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --