Rich Shepard <[EMAIL PROTECTED]> wrote:
I have a table, 'voting,' with 31 columns. For each of 28 REAL
columns I need to calculate averages both by groups and total. I
tried:
sqlite> select AVG(pos) from voting where cat = 'eco';
and 0.0 was returned.
The query looks good. What's the data in the pos column? Could it be
that the average is indeed zero?
What I need to do with the data from table 'voting' is (in Python
using psqlite2) is to calculate the average of each of 28 numeric
columns for each of the three 'pos' column values within each of the
three 'cat' column values.
select cat, pos, avg(col1), avg(col2), ...
from voting
group by cat, pos;
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------