403Webshell
Server IP : 104.21.13.164  /  Your IP : 216.73.216.44
Web Server : Apache
System : Linux gator4057.hostgator.com 5.14.0-687.17.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 22 07:21:26 EDT 2026 x86_64
User : badawi ( 1130)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/firebird/sql.extensions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/firebird/sql.extensions/README.statistical_functions.txt
---------------------
Statistical Functions
---------------------

By the SQL specification, some statistical functions are defined.
Function about variance and standard deviation are bellow.

VAR_SAMP: return  the sample variance.
  eq. (SUM(<expr> ^ 2) - SUM(<expr>) ^ 2 / COUNT(<expr>)) / (COUNT(<expr>) - 1)

VAR_POP: return the population variance.
  eq. (SUM(<expr> ^ 2) - SUM(<expr>) ^ 2 / COUNT(<expr>)) / COUNT(<expr>)

STDDEV_SAMP: return the sample standard deviation.
  eq. SQRT(VAR_SAMP(<expr))

STDDEV_POP: return the population standard deviation.
  eq. SQRT(VAR_POP(<expr>))

COVAR_SAMP: return the sample population.
  eq. (SUM(<expr1> * <expr2>) - SUM(<expr1>) * SUM(<expr2>) / COUNT(*)) / (COUNT(*) - 1)

COVAR_POP: return the population covariance.
  eq. (SUM(<expr1> * <expr2>) - SUM(<expr1>) * SUM(<expr2>) / COUNT(*)) / COUNT(*)

CORR: returns the coefficient of correlation.
  eq. COVAR_POP(<expr1>, <expr2>) / (STDDEV_POP(<expr2>) * STDDEV_POP(<expr1>))

Author:
    Hajime Nakagami <[email protected]>

Syntax:
    <single param statistical function> ::= <single param statistical function name>(<expr>)
    <single param statistical function name> := { VAR_POP | VAR_SAMP | STDDEV_POP | STDDEV_SAMP }

    <dual param statistical function> ::= <dual param statistical function name>(<expr1>, <expr2>)
    <dual param statistical function name> := { COVAR_POP | COVAR_SAMP | CORR }

Note:
    If VAR_SAMP, STDDEV_SAMP, COVAR_SAMP and result count is 0 or 1, return NULL.
    If VAR_POP, STDDEV_POP, COVAR_POP, CORR and result count is 0, return NULL.

Example:
    SELECT STDDEV_SAMP(salary) FROM employees;

Youez - 2016 - github.com/yon3zu
LinuXploit