Обсуждение: Aggregates don't work on views?

Поиск
Список
Период
Сортировка

Aggregates don't work on views?

От
Jeremy Buchmann
Дата:
Hello all,

I am trying to select the sum of a column in a view, but it doesn't give me
any data.  Check this out (h_2535c_1_this is the view):

rb=> select avg_rate from h_2535c_1_this;
avg_rate
--------
    40.5
      51
      38
      37
(4 rows)

rb=> select sum(avg_rate) from h_2535c_1_this;
sum
---




(4 rows)


What's happening here?  I'm using pg 6.5.3 (yes, I know it's time to
upgrade, I will when it's feasible to take down our production server) on
Linux 2.2.19 (SuSE).

Thanks,

-- Jeremy



Re: Aggregates don't work on views?

От
Tom Lane
Дата:
Jeremy Buchmann <jeremy@wellsgaming.com> writes:
> I am trying to select the sum of a column in a view, but it doesn't give me
> any data.

Try 7.1.

            regards, tom lane