Subject | Re: [firebird-support] Standard Deviation calculation using select query ? |
---|---|
Author | unordained |
Post date | 2005-07-12T21:35:40Z |
Since nobody else is replying to this ...
a) No, it's not an available aggregate function, nor is the MEAN() you would need in order to
calculate the STDDEV manually.
b) No, you can't add it as a user-defined-function (UDF) because Interbase and Firebird don't
expose an API by which your own functions could get multiple rows of data. (I learned this when I
asked about a product-aggregate instead of an additive-aggregate.)
So if it's not built-in, and you can't add it as a UDF, then that pretty much leaves you writing a
stored procedure (SP). I'm terrible at writing SP's, so you'll want to get help from someone else.
It's possible someone already has one written. A very quick google search isn't turning one up.
-Philip
---------- Original Message -----------
From: "mario1fb" <mario1fb@...>
a) No, it's not an available aggregate function, nor is the MEAN() you would need in order to
calculate the STDDEV manually.
b) No, you can't add it as a user-defined-function (UDF) because Interbase and Firebird don't
expose an API by which your own functions could get multiple rows of data. (I learned this when I
asked about a product-aggregate instead of an additive-aggregate.)
So if it's not built-in, and you can't add it as a UDF, then that pretty much leaves you writing a
stored procedure (SP). I'm terrible at writing SP's, so you'll want to get help from someone else.
It's possible someone already has one written. A very quick google search isn't turning one up.
-Philip
---------- Original Message -----------
From: "mario1fb" <mario1fb@...>
> Interbase alows for quick calculation of Sum, Average, etc. using------- End of Original Message -------
> simple select statement:
> e.g.
> select AVG(INDEX), SUM(INDEX) from DATATABLE
>
> Is there a way of calculating Standard Deviation (STDDEV) using
> similar technique ?
> How about Firebird capabilities in this area ?
>
> Mario