View Single Post

   
  #4 (permalink)  
Old 02-27-2008, 06:35 AM
Knut Stolze
 
Posts: n/a
Default Re: Computing the product of a column groupped by...

Tonkuma wrote:

> My two ideas.
> 1) EXP(SUM(LOG(val)))
> But, this returns floating point number. So, exact value could not be
> received.
>
> 2) Use recursive query. (and common table expression, if you want
> combine with other data)


Another alternative is to roll your own aggregates. But this is not
trivial: http://tinyurl.com/7z49y and for groupings:
http://tinyurl.com/b2rq5

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Reply With Quote