FIND Statement
Statements
058057 Tandem Computers Incorporated
4–21
When you explicitly request summary records you get target-records summarized
down to the lowest level where an aggregate is calculated over that level. For
example:
SET @SUMMARY-ONLY TO ON;
FIND findfil
( BY employee.dept,
BY employee.job,
BY employee.empname,
employee.salary,
COUNT(employee.empname OVER employee.job);
returns one target-record for each job in each department. Only the first employee
name (empname) for each job is returned.
When you implicitly request summary records, you get target-records summarized
down to the lowest level where an aggregate is computed over that level. (A query
requesting only by-items and aggregates over ALL is not an implicit request for
summary records). For example:
SET @SUMMARY-ONLY TO OFF;
FIND findfil
(BY employee.dept,
BY employee.job,
BY employee.empname,
numemp:= COUNT (employee.empname OVER employee.job));
returns one target-record for each job in each department. Only the first employee
name (empname) for each job is returned.
If you want summary records that consist of only by-items and aggregates to include
those where the last value of a by-item has not changed but a subordinate by-item
value has changed, then you must include a target-item in the target-list that has not
appeared as a by-item or aggregate. Of course, you must also set @SUMMARY-ONLY
to OFF. For example:
SET @SUMMARY-ONLY TO OFF;
FIND findfil2
(BY employee.dept,
BY employee.job,
BY employee.empname,
employee.salary,
numemp:= COUNT (empname OVER job));
Summary of Contents for ENFORM 058057
Page 6: ...New and Changed Information 058057 Tandem Computers Incorporated v...
Page 18: ...Preface xvi 058057 Tandem Computers Incorporated This page left intentionally blank...
Page 19: ...Preface 058057 Tandem Computers Incorporated xvii...
Page 269: ...Glossary Glossary 4 058057 Tandem Computers Incorporated This page left intentionally blank...