I want to get sum of estimate quantity from estimates table gropBy material_id. Also want get sum of mprs quantity related to previous query table.
My estimates table is as below
| id | project_id | material_id | estimatequantity |
| 1 | 1 | 1 | 500 |
| 2 | 1 | 2 | 899 |
| 3 | 1 | 1 | 250 |
and my mprs table is as below
id estimate_id mprquantity 1 1 334 2 1 1 3 2 273 4 1 20now I want to generate below table
material id Estimated mprs 1 750 355 2 899 273I searched everywhere but failed.