Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Example


Code Block
SELECT  AVG(Salary)  FROM  Employee

...

COUNT

Returns the count of all rows, or of non-null values.

Example


Code Block
SELECT COUNT(*) FROM Employee
GO
SELECT COUNT(ID) FROM Employee
GO

...


MAX

Returns the highest value.

Example


Code Block
SELECT MAX(Salary) FROM Employee

...

MIN

Returns the lowest value.

Example


Code Block
SELECT MIN(Salary) FROM Employee

...


SUM

Returns the sum of all values.

Example


Code Block
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.

Example


Code Block
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.
 ExampleExample


Code Block
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.

...