The COUNT command displays the number of file items that meet the specified conditions. This makes it possible to count the number of items in a file, the frequency with which a constant occurs in a file, and the number of items that meet a condition expressed with relational operators. For instance:
The number of customers in the CUSTOMERS file:
>COUNT CUSTOMERS 543 ITEMS COUNTED |
The number of customers who live in Indiana:
>COUNT CUSTOMERS WITH STATE "IN" 36 ITEMS COUNTED |
The number of orders in the ORDERS file that were placed after December 31, 1987:
>COUNT ORDERS WITH DATE > "12/31/97" 256 ITEMS COUNTED. |
The number of orders for which at least two copies of one of the titles ordered were requested (QTY is the attribute in the ORDERS file that reflects the number of books sold for each title):
>COUNT ORDERS WITH QTY GE "2" 112 ITEMS COUNTED |
See Also