I don't know which DBMS you're using, but some will get upset that you are using .avg
(because avg
is reserved) and require you to escape it.
Try changing it from avg
to average
, just as a test:
SELECT comp_table.average
FROM (SELECT column_1, avg(column_2) as average
FROM table_1, GROUP BY column_1) comp_table
egrunin
2010-09-17 04:26:26