[snip]
The mathematical way to add two "partial" harmonic means to generate new
harmonic mean is:

Let X1  , X2 be two harmonic means on different rollup rows, generated
using
n1 and n2 # of facts respectively.

The combined harmonic mean would be:

(n1 + n2)/( n1/x1 + n2/x2)

If you have experience with computing harmonic mean in SQL, please
share.
[/snip]

Unless I am misunderstanding your question the simplest method would be;

SELECT ((n1 + n2)/(n1/x1 + n2/x2)) AS "Harmonic Mean" 

...without knowing the structure of the data. If X1 and X2 live on 2
different rows you could write a stored procedure to retrieve the
relevant data and produce an output.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to