Database Reference
In-Depth Information
If you take the ReoccurringPayment table, you can produce the Top Performers Report using the
query shown in Listing 10-9.
Listing 10-9:  A Top Performers Report
Select Top 10 CustomerKey,
Sum(PaymentAmount) TotalPaymentAmount
From ReoccurringPayment
Group By CustomerKey
Order By Sum(PaymentAmount) Desc
Creating an Exception List Report
An example of an Exception List Report could be: Who are your customers with a total revenue
amount greater than $1,000? You use the ReoccurringPayment table. The SQL query to produce this
report is shown in Listing 10-10.
Listing 10-10:  A Exception List Report
Select CustomerKey,
Sum(PaymentAmount) TotalPaymentAmount
From ReoccurringPayment
Group By CustomerKey
Having Sum(PaymentAmount)>1000
Order By CustomerKey
 
Search WWH ::




Custom Search