SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
A-76
Audited Tables
might leave the AUDITCOMPRESS attribute off. You can use the ALTER TABLE
statement to turn the attribute back on.
Audited Tables
Audited tables are tables audited by TMF. TMF monitors all transactions against
audited tables in preparation for possible transaction backout or TMF recovery
operations.
NonStop SQL/MP creates audited tables by default, but you can specify the creation of
a nonaudited table (or change an audited table to a nonaudited table) with the AUDIT
file attribute for the table.
All SQL/MP catalog tables are audited. In addition, SQL tables must reside on audited
volumes, even if the tables themselves are not audited.
For information, see TMF Transactions on page T-6.
AVG Function
AVG is a function that computes the average of a set of numbers.
The data type of the result depends on the data type of the argument. If the argument
is an exact numeric type, the result is LARGEINT. If the argument is FLOAT, REAL, or
DOUBLE PRECISION type, the result is DOUBLE PRECISION.
The scale of the result is the same as the scale of the argument. If the argument has
no scale, the result is truncated.
[ ALL ] expression
specifies a numeric or INTERVAL expression that indicates the set of values to
average.
The expression must include a value from each row of the result table (that is, at
least one column from the result table), and cannot include the COUNT, MAX, MIN,
or SUM functions, or another AVG function. For example,
AVG (SALARY)
AVG (PARTCOST * QTY_ORDERED)
ALL is an optional keyword that does not change the meaning of the clause.
Unless you use the DISTINCT clause, SQL uses all rows whether or not you
specify ALL.
AVG { ( [ ALL ] expression ) }
{ ( DISTINCT column ) }