Database Reference
In-Depth Information
The query results appear in Figure 3-36.
93
Column heading created
by Access for a ield
containing an expression
Num ber of records in
item class HW
FIGURE 3-36
Query results
If your implementation of SQL doesn
'
t permit the use of the * symbol, you could write the query as
follows:
SELECT COUNT(PartNum)
FROM Part
WHERE Class= ' HW '
;
EXAMPLE 19
Find the number of customers and the total of their balances.
other than the obvious fact that they are comput-
ing different statistics. In the case of SUM, you must specify the field for which you want a total and the field
must be numeric. (How could you calculate a sum of names or addresses?) The query design appears in
Figure 3-37.
There are two differences between COUNT and SUM
COUNT function
SUM function
FIGURE 3-37
SQL query to count records and calculate a total
Search WWH ::




Custom Search