Database Reference
In-Depth Information
The query results appear in Figure 3-38.
94
Number of
customers
Sum of all
customers'
balances
FIGURE 3-38
Query results
The use of AVG, MAX, and MIN is similar to the use of SUM. The only difference is that different statis-
tics are calculated.
EXAMPLE 20
Find the total number of customers and the total of their balances. Change the column names for the number
of customers and the total of their balances to CustomerCount and BalanceTotal, respectively.
As with computed fields, you can use the word AS to assign names to these computations, as shown in
Figure 3-39.
Name for sum of
balances
Name for count
of customers
FIGURE 3-39
SQL query to perform calculations and rename columns
The query results appear in Figure 3-40.
New column
names
FIGURE 3-40
Query results
Search WWH ::




Custom Search