I have a Customer registry
ID NOME GRUPO
2033 JOAO FORNECEDORES
2044 MARIA MANUTENCAO
2055 JOSE FORNECEDORES
And I have a purchase record 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 make a query that returns me the expense per group?
GRUPO TOTAL_GASTO
FORNECEDORES 9.153
MANUTENCAO 13.360
What about each customer?
CLIENTE TOTAL_GASTO
JOAO 5.130
MARIA 13.360
JOSE 4.023