A summary query, as opposed to a simple query, is used to extract aggregate of data items for a group of records rather than a detailed set of records. This query type is of particular importance in accounting because the accounting reports are based on summarisation of transaction data. Consider the following SQL statement:
SELECT Code, Name, Sum(Amount)
From Vouchers INNER JOIN Accounts
ON (Accounts, Code=Vouches.Debit)
GROUP BY Code, Name
In the above query, the Vouchers table has been joined with Accounts table on the basis of Codefield of Accounts and Debitfield of Vouchers. The resultant record set has been grouped on the basis of Code and name of accounts. Accordingly, the sum of amount for each group (or set of records) has been ascertained and displayed. Finding the sum is the process of summarisation.