Re: function ave(integer) does not exist

Поиск
Список
Период
Сортировка
От Benedict Holland
Тема Re: function ave(integer) does not exist
Дата
Msg-id CAD+mzoygY3PeS9_MDqJGQgJsVYtGxV=HCBGDvW_6L0es4E=N+g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: function ave(integer) does not exist  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
Oh heck. Yes, I misread avg(expression as ave. Sorry for this.

~ben

On Tue, Jul 3, 2012 at 2:13 PM, hubert depesz lubaczewski <depesz@depesz.com> wrote:
On Tue, Jul 03, 2012 at 02:07:54PM -0400, Benedict Holland wrote:
> This one is confusing. The only difference in my db is that it comes from a
> user specific template not pg_default.

"difference"? between what and what?

> select ave(var)
> from test;
> ***********************************************************************************************************************************************************
>
>
> and I get this as the error:
>
> ***********************************************************************************************************************************************************
> ERROR:  function ave(integer) does not exist
> LINE 1: select ave(var)
>                ^

Never heard of ave() function. What should it do?

> So why is this happening? I can run a "select sum(var)" and it works.

Well, sum() works, because such function (aggregate actually) exists.

Hmm .. perhaps you're looking for avg() - to get average value?

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

В списке pgsql-general по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: function ave(integer) does not exist
Следующее
От:
Дата:
Сообщение: TG_COLUMNS_UPDATED