I have a raw data as shown in table below. I want to get(Sum up) previous 4 weeks data.Can any one guide me how to get this by SQL Select query.
Raw data table :
Week Year Category Weekly Total
9 2017 Motor 8
8 2017 Car 7
8 2017 Motor 5
7 2017 Car 4
6 2017 Car 8
5 2017 Car 16
5 2017 Motor 15
4 2017 Car 8
3 2017 Car 5
2 2017 Car 3
1 2017 Car 12
52 2016 Car 8
51 2016 Car 6
Expected Output:
Week Year 4Weeks Total
9 2017 32
8 2017 55
7 2017 51
6 2017 52
5 2017 47
4 2017 28
3 2017 28
2 2017 29
1 2017 26
52 2016 14
51 2016 6