Subject Re: Register standard deviation as a stored procedure.
Author tankinguard
When remaking by the method which you taught, I have got the result.
But it does not become still like MySQL. mmm...

-----------------------------------------
SET TERM !!;
CREATE OR ALTER PROCEDURE STDEV(sTable CHAR(31), sField CHAR(31))
RETURNS (nResult DOUBLE PRECISION) AS
BEGIN
EXECUTE STATEMENT 'SELECT SQRT((COUNT(' || sField || ') *
SUM(POWER(' || sField || ', 2)) - POWER(SUM(' || sField || '), 2))
/ (COUNT(' || sField || ') * (COUNT(' || sField || ') - 1))) FROM ' || sTable
INTO :nResult;
END !!
SET TERM;!!
-----------------------------------------
EXECUTE PROCEDURE STDEV('table', 'score');
-----------------------------------------