background image
<< Built-in functions | ABS or ABSVAL function >>

Aggregates - set functions

<< Built-in functions | ABS or ABSVAL function >>
Derby Reference Manual
111
·
FLOOR function
·
HOUR function
·
IDENTITY_VAL_LOCAL function
·
INTEGER function
·
LENGTH function
·
LN or LOG function
·
LOG10 function
·
LOCATE function
·
LCASE or LOWER function
·
LTRIM function
·
MINUTE function
·
MOD function
·
MONTH function
·
PI function
·
RADIANS function
·
RTRIM function
·
SECOND function
·
SESSION_USER function
·
SIN function
·
SMALLINT function
·
SQRT function
·
SUBSTR function
·
TAN function
·
TIME function
·
TIMESTAMP function
·
TRIM function
·
UCASE or UPPER function
·
USER function
·
VARCHAR function
·
YEAR function
Aggregates (set functions)
This section describes aggregates (also described as set functions in ANSI SQL-92 and
as column functions in some database literature). They provide a means of evaluating
an expression over a set of rows. Whereas the other built-in functions operate on a
single expression, aggregates operate on a set of values and reduce them to a single
scalar value. Built-in aggregates can calculate the minimum, maximum, sum, count, and
average of an expression over a set of values as well as count rows.
The built-in aggregates can operate on the data types shown in the following table.
Table 7.
Permitted data types for built-in aggregates
Function Name
Permitted Data Types
COUNT
All types
MIN
Numeric built-in data types
MAX
Numeric built-in data types
AVG
Numeric built-in data types
SUM
Numeric built-in data types
Aggregates are permitted only in the following:
· A SelectItem in a
SelectExpression
.
· A
HAVING clause
.