6.4 Precision and Accuracy
■
161
This request connects each project manager to his or her staffing
(personnel) table entry so that the total management costs for each project
with a budget in excess of $4000 can be calculated (compare this to the
previous relational algebra request, which does the same thing).
On the other hand, the group by statement collects sets of records
according to one or more related columns. The associated having state-
ment functions like a filter on the group, indicating which records should
participate in the group. The following example illustrates the use of a
group by and having statement.
select projmgr
from projects
group by projectid Having count(*) > 1
This query selects all project managers who manage more than one
project. ...