NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
A-6
AGGREGATE Functions
AGGREGATE Functions
NonStop SQL/MP provides the following aggregate functions:
For more information, see the entry for a specific function.
Alias
An alias is a name assigned to a column in the select list of the SELECT command
using the SQLCI report writer NAME command. You can use an alias to refer to the
column in other parts of a report definition, such as a DETAIL command.
Use aliases to define abbreviations for long column names and to assign informative
names to columns that consist of expressions.
An alias is not the same as a detail alias, which is a name assigned to a print item using
the NAME clause of the DETAIL command. You can use a detail alias in report
formatting commands such as TOTAL and SUBTOTAL but not in the DETAIL
command itself.
ALLOCATE File Attribute
ALLOCATE is a Guardian file attribute that reserves disk space for a file, or frees disk
space previously reserved for the file but that does not contain data. ALLOCATE applies
to key-sequenced, relative, and entry-sequenced tables and to indexes.
Allocating disk space in advance ensures that space is available when needed and avoids
processing errors caused by full or fragmented disks during normal allocation-on-
demand.
ALLOCATE num-extents
specifies the number of extents to allocate in advance. The number must be an
integer between 1 and the current value of the MAXEXTENTS file attribute.
(MAXEXTENTS can be up to 959 for each partition, but the MAXEXTENTS value
for a specific partition can be less than 959.)
AVG Function Computes the average of a set of numbers.
COUNT Function Counts the number of rows that result from a query or the number of
rows that contain a distinct value in a specific column.
MAX Function Determines a maximum value.
MIN Function Determines a minimum value.
SUM Function Computes the sum of a set of numbers.
{ ALLOCATE num-extents }
{ DEALLOCATE }
The default is ALLOCATE 1.