First page Back Continue Last page Image
Using Multiple Summary Queries
SELECT 'After 1/1/2018' AS selection_date,
COUNT(*) AS number_of_invoices,
ROUND(AVG(invoice_total), 2) AS avg_invoice_amt,
SUM(invoice_total) AS total_invoice_amt
FROM invoices
WHERE invoice_date > '2018-01-01'
Statically Label the Row with a String
Count the number of Records
Calculate the Average invoice amount and Round it to 2 places
Add up all the invoice totals
The Output for this Query