I do not understand what it is, and I thought if anyone could help me with this.
I have 2 tables called RES_DATA and INV_DATA
RES_DATA Contains my client below
CUSTOMER ID | NAME 1, Robert 2, John 3, Peter
INV_DATA Contains their MESSAGES as below
INVOICE ID | CUSTOMER ID | AMOUNT 100, 1, £49.95 200, 1, £105.95 300, 2, £400.00 400, 3, £150.00 500, 1, £25.00
I am trying to write a SELECT STATEMENT that will give me the results below.
CUSTOMER ID | NAME | TOTAL AMOUNT 1, Robert, £180.90 2, John, £400.00 3, Peter, £150.00
I think I need 2 INNER JOINS. Somehow adding tables and SUM values to the INVOICES GROUPED by Customer Table table, but honestly, I missed something. I can’t even get closer to the results that I need.