4
I have a customer record
ID NOME GRUPO
2033 JOAO FORNECEDORES
2044 MARIA MANUTENCAO
2055 JOSE FORNECEDORES
And I have a record of purchases made by each customer
ID_CLIENTE VALOR_COMPRA
2033 4.000
2033 1.130
2044 8.930
2044 4.430
2055 4.023
How to perform a query that returns my expenses per group?
GRUPO TOTAL_GASTO
FORNECEDORES 9.153
MANUTENCAO 13.360
And for every customer?
CLIENTE TOTAL_GASTO
JOAO 5.130
MARIA 13.360
JOSE 4.023