Re: Calculating product from rows - (aggregate product )

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Calculating product from rows - (aggregate product )
Date: 2009-05-04 11:10:46
Message-ID: 20090504111046.GF5414@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Jasen Betts :
> > Is there an already existing function that does this.
>
> here's one way to cheat: logarythms.
>
> select exp(sum(ln( thiscolumn ))) from foo;
>
> :^)

nice ;-)

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Buś 2009-05-04 11:24:13 Re: could not bind IPv4 socket
Previous Message Jasen Betts 2009-05-04 11:00:52 Re: keeping track of function execution