Neoview SQL Reference Manual (R2.2)

6 SQL Functions and Expressions
This section describes the syntax and semantics of specific functions and expressions that you
can use in Neoview SQL statements. The functions and expressions are categorized according
to their functionality.
Categories
Use these types of functions within an SQL value expression:
Aggregate (Set) Functions”
“Character String Functions”
“Datetime Functions”
“Mathematical Functions”
“Sequence Functions”
“Other Functions and Expressions”
For more information on SQL value expressions, see “Expressions” (page 208).
Standard Normalization
For datetime functions, the definition of standard normalization is: If the ending day of the
resulting date is invalid, the day will be rounded DOWN to the last day of the result month.
Aggregate (Set) Functions
An aggregate (or set) function operates on a group or groups of rows retrieved by the SELECT
statement or the subquery in which the aggregate function appears.
Computes the average of a group of numbers derived
from the evaluation of the expression argument of the
function.
AVG Function” (page 293)
Counts the number of rows that result from a query (by
using *) or the number of rows that contain a distinct value
in the one-column table derived from the expression
argument of the function (optionally distinct values).
“COUNT Function” (page 310)
Determines a maximum value from the group of values
derived from the evaluation of the expression argument.
“MAX/MAXIMUM Function” (page 361)
Determines a minimum value from the group of values
derived from the evaluation of the expression argument.
“MIN Function” (page 362)
Computes the statistical standard deviation of a group of
numbers derived from the evaluation of the expression
argument of the function. The numbers can be weighted.
“STDDEV Function” (page 409)
Computes the sum of a group of numbers derived from
the evaluation of the expression argument of the function.
“SUM Function” (page 413)
Computes the statistical variance of a group of numbers
derived from the evaluation of the expression argument
of the function. The numbers can be weighted.
“VARIANCE Function” (page 430)
Note that columns and expressions can be arguments of an aggregate function. The expressions
cannot contain aggregate functions or subqueries.
An aggregate function can accept an argument specified as DISTINCT, which eliminates duplicate
values before the aggregate function is applied. See “DISTINCT Aggregate Functions” (page 152).
If you include a GROUP BY clause in the SELECT statement, the columns you refer to in the
select list must be either grouping columns or arguments of an aggregate function. If you do not
Categories 279