Page History
...
Aggregate Functions
AVG
Returns the average (mean) value. If no rows are selected, the result is NULL. Aggregates are only allowed in select statements. The returned value is of the same data type as the parameter.
...
SELECT AVG(Salary) FROM Employee
COUNT
Returns the count of all rows, or of non-null values.
...
SELECT COUNT(*) FROM Employee
GO
SELECT COUNT(ID) FROM Employee
GO
MAX
Returns the highest value.
...
SELECT MAX(Salary) FROM Employee
MIN
Returns the lowest value.
...
SELECT MIN(Salary) FROM Employee
SUM
Returns the sum of all values.
...
SELECT SUM(Salary) FROM Employee
GROUP_CONCAT
Concatenates strings with a separator. The default separator is a ',' (without space). This method returns a string. If no rows are selected, the result is NULL
. Aggregates are only allowed in select statements.
...
SELECT GROUP_CONCAT(First_name ORDER BY E_id SEPARATOR ';') FROM Employee
SELECTIVITY
Estimates the selectivity (0-100) of a value. The value is defined as (100 * distinctCount / rowCount). The selectivity of 0 rows is 0 (unknown). Up to 10000 values are kept in memory. Aggregates are only allowed in select statements.
...
SELECT SELECTIVITY(First_name), SELECTIVITY(City) FROM Employee WHERE ROWNUM() < 2
BOOL_AND, BOOL_OR
BOOL_AND returns true if all expressions are true. BOOL_OR returns true if any expression is true.
...
SELECT BOOL_OR(Name LIKE 'W%') FROM Employee
STDDEV_POP, STDDEV_SAMP
STDDEV_POP returns the population standard deviation while STDDEV_SAMP returns the sample standard deviation.
...
SELECT STDDEV_SAMP(ID) FROM Employee
VAR_POP, VAR_SAMP
VAR_POP returns the population variance while VAR_SAMP returns the sample variance.
...