tags:

views:

854

answers:

4

Hi, I have in my table a column that has values of type FLOAT. How can I get average value of all elements in this column?

Thank you in advance.

+2  A: 
SELECT AVG(column) FROM ...
soulmerge
+1  A: 

select avg(column) from table;

Matthew Flaschen
+3  A: 
select avg(col1) from table;
Jérôme
+8  A: 
select avg( columnname) from table;

This will average all rows. To average a subset, use a where clause. To average for each group (of something) use a group by clause.

tpdi