I have the table below:
date | shop_id | package_id | quantity
01/01/2017 | 1 | 1 | 1
01/01/2017 | 1 | 2 | 5
01/01/2017 | 2 | 1 | 10
01/01/2017 | 2 | 2 | 4
02/01/2017 | 1 | 1 | 14
02/01/2017 | 1 | 2 | 3
....
I want to sum the quantities of all the previous records having the same shop and the same package, like the following
date | shop_id | package_id | sum_quantity
01/01/2017 | 1 | 1 | 1
01/01/2017 | 1 | 2 | 5
01/01/2017 | 2 | 1 | 10
01/01/2017 | 2 | 2 | 4
02/01/2017 | 1 | 1 | 15
02/01/2017 | 1 | 2 | 8
....