I have 2 tables linked by id and I need to add a field in table 2 by grouping through a field in table 1
-----TABELA 1-----
ID_tab1 - tipo_pgto
-----TABELA 2-----
ID_tab2 - ID_tab1 - valor_pago
I want you to show me the sum of the amount paid that is in table 2 but grouped by type_pgto that is in table 1