UnityJDBC - Aggregate Functions

Aggregate functions operate on sets of values and return a single value.

Summary

Function Syntax Description
AVG AVG(expr) Returns the average of expr.
AVG Returns the average of expr ignoring duplicates.
BIT_AND BIT_AND(expr) Returns the bitwise AND of all bits in expr.
BIT_OR BIT_OR(expr) Returns the bitwise OR of all bits in expr.
BIT_XOR BIT_XOR(expr) Returns the bitwise XOR of all bits in expr.
CORR CORR(expr1, expr2) Returns the coefficient of correlation of a set of number pairs.
COUNT COUNT(expr) Returns a count of the number of non-NULL values of expr.
COUNT DISTINCT Returns a count of the number of rows with no duplicates.
COUNT(*) COUNT(*) Returns a count of the number of rows.
COVAR_POP COVAR_POP(expr1, expr2) Returns the population covariance of a set of number pairs (expr1, expr2).
COVAR_SAMP COVAR_SAMP(expr1, expr2) Returns the sample covariance of a set of number pairs (expr1, expr2).
GROUP_CONCAT GROUP_CONCAT(expr) Produces a string by concatenating all values of expr.
MAX MAX(expr) Returns the maximum value of expr.
MEDIAN MEDIAN(expr) Returns the median value of expr.
MIN MIN(expr) Returns the minimum value of expr.
STD STD(expr) Returns the sample standard deviation of a set of numbers (expr).
STDDEV STDDEV(expr) Returns the sample standard deviation of a set of numbers (expr).
STDDEV_POP STDDEV_POP(expr) Returns the population standard deviation of a set of numbers (expr).
STDDEV_SAMP STDDEV_SAMP(expr) Returns the sample standard deviation of a set of numbers (expr).
SUM SUM(expr) Returns the sum of expr.
VARIANCE VARIANCE(expr) Returns the sample variance of a set of numbers (expr).
VAR_POP VAR_POP(expr) Returns the population variance of a set of numbers (expr).
VAR_SAMP VAR_SAMP(expr) Returns the sample variance of a set of numbers (expr).

Detailed Function Descriptions

AVG

Syntax: AVG(expr)

Returns the average of expr. Returns NULL if there were no matching rows.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

AVG

Syntax:

Returns the average of expr ignoring duplicates. Returns NULL if there were no matching rows.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

BIT_AND

Syntax: BIT_AND(expr)

Returns the bitwise AND of all bits in expr.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

BIT_OR

Syntax: BIT_OR(expr)

Returns the bitwise OR of all bits in expr.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

BIT_XOR

Syntax: BIT_XOR(expr)

Returns the bitwise XOR of all bits in expr.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

CORR

Syntax: CORR(expr1, expr2)

Returns the coefficient of correlation of a set of number pairs (expr1, expr2).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

COUNT

Syntax: COUNT(expr)

Returns a count of the number of non-NULL values of expr. Returns 0 if there were no matching rows.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

COUNT DISTINCT

Syntax:

Returns a count of the number of non-NULL values of expr with no duplicates.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

COUNT(*)

Syntax: COUNT(*)

Returns a count of the number of rows retrieved, whether or not they contain NULL values.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

COVAR_POP

Syntax: COVAR_POP(expr1, expr2)

Returns the population covariance of a set of number pairs (expr1, expr2).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

COVAR_SAMP

Syntax: COVAR_SAMP(expr1, expr2)

Returns the sample covariance of a set of number pairs (expr1, expr2).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

GROUP_CONCAT

Syntax: GROUP_CONCAT(expr)

Grouping function that concatenates to form a single string all elements in the group. A comma is used as a separator.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

MAX

Syntax: MAX(expr)

Returns the maximum value of expr. Returns NULL if there were no matching rows.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

MEDIAN

Syntax: MEDIAN(expr)

Returns the median value of expr.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

MIN

Syntax: MIN(expr)

Returns the minimum value of expr. Returns NULL if there were no matching rows.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

STD

Syntax: STD(expr)

Returns the sample standard deviation of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

STDDEV

Syntax: STDDEV(expr)

Returns the sample standard deviation of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

STDDEV_POP

Syntax: STDDEV_POP(expr)

Returns the population standard deviation of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

STDDEV_SAMP

Syntax: STDDEV_SAMP(expr)

Returns the sample standard deviation of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

SUM

Syntax: SUM(expr)

Returns the sum of expr. Returns NULL if there were no matching rows.

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

VARIANCE

Syntax: VARIANCE(expr)

Returns the sample variance of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

VAR_POP

Syntax: VAR_POP(expr)

Returns the population variance of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB

VAR_SAMP

Syntax: VAR_SAMP(expr)

Returns the sample variance of a set of numbers (expr).

SQL Server Access Oracle PostgreSQL MySQL Sybase HSQLDB