I have a MySQL table, with Customer ID, Initial Due, Date and Subscription I need to make a query that adds all the values with the same id of the table and shows it in a new column, in the row of its related id.
Table:
CI
| Deu_Inc
| Fecha
|
Abonos
1
| 100.00
|
1-2-18
| 20
1
| 100.00
|
2-3-18
| 50
2
| 600.00
|
1-2-18
| 30
2
| 600.00
|
2-3-18
| 50
3
| 120.60
|
1-2-18
| 60
3
| 120.60
|
2-3-18
| 20
Desired result:
CI
| Deu_Inc
|
suma
| Total
1
|
100.00
|
70
|
30
2
|
600.00
|
80
|
520
3
|
120.60
|
80
|
40.60