Aggregates
ENFORM Language Elements
058057 Tandem Computers Incorporated
3–21
Qualification Aggregate with an Embedded WHERE Clause
If a qualification aggregate contains a WHERE clause that restricts the records for the
aggregate calculation, ENFORM processes the embedded WHERE clause before the
aggregate. If any record for an over-item does not satisfy the restriction specified in the
embedded WHERE clause, ENFORM excludes that record from the aggregate
calculation.
For example consider Figure 3-6. This figure shows an ENFORM query containing a
qualification aggregate with a WHERE clause. The query prints the part number and
the amount in stock of all the parts where the price of the part is greater than the
average price of all parts not in stock.
Figure 3-6. Qualification Aggregate with Embedded WHERE Clause
OPEN parts;
LIST partnum,
inventory,
WHERE price GT AVG (price WHERE inventory LT 0);
The report produced is:
Part Number
INVENTORY
212
7
244
3
1403
21
5502
6
5504
–1
5505
0
7102
20
Aggregates and Scale
All the aggregates except COUNT take their display format from the formats of the
input values. (COUNT always returns a value with a scale of zero, or no digits to the
right of the decimal point.) Consequently, if a field is defined as an integer and the
aggregate yields a fractional value, the aggregate returns only the whole portion of the
value. If the field is defined as a decimal, the value returned is accurate to the number
of decimal places provided by the DDL data definition for the field.
Содержание ENFORM 058057
Страница 5: ...New and Changed Information iv 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 6: ...New and Changed Information 058057 Tandem Computers Incorporated v...
Страница 18: ...Preface xvi 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 19: ...Preface 058057 Tandem Computers Incorporated xvii...
Страница 21: ...Notation Conventions xviii 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 25: ...ENFORM Terminology Introduction 1 4 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 121: ...TITLE Statement Statements 4 50 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 227: ...ENFORM Procedures ENFORM Syntax Summary A 16 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 269: ...Glossary Glossary 4 058057 Tandem Computers Incorporated This page left intentionally blank...