Re: Calculating product from rows - (aggregate product )

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Calculating product from rows - (aggregate product )
Дата
Msg-id 20848.1241481099@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Calculating product from rows - (aggregate product )  (Dennis Brakhane <brakhane@googlemail.com>)
Список pgsql-general
Dennis Brakhane <brakhane@googlemail.com> writes:
> On Mon, May 4, 2009 at 12:53 PM, Jasen Betts <jasen@xnet.co.nz> wrote:
>> select exp(sum(ln( thiscolumn ))) from foo;

> Keep in mind that it won't work when the table containts negative
> numbers, though (or zeros, but since in this case the product is also
> zero, it doesn't matter)

Its numerical stability probably leaves something to be desired, too...
but it is a cute solution.

            regards, tom lane

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Calculating product from rows - (aggregate product )
Следующее
От: Bill Moseley
Дата:
Сообщение: Re: Tracking down a deadlock