Please Provide an answer in MYSQL workbench Provide the total dollar amount of i
ID: 3724120 • Letter: P
Question
Please Provide an answer in MYSQL workbench
Provide the total dollar amount of invoices for each customer in the Invoice table that has more than one invoice, return the CustomerId and this totalled amount.
customer table:
Columns:
int(11)
invoice table:
Columns:
int(11)
Explanation / Answer
select CustomerId, sum(Total)
from invoices
group by CustomerId
having count(*) > 1
This query returns customer id and a total bill of customers who have more than 1 invoice.
**Comment for any further queries.