I have table like this
id date score
1 2017-01-01 5
1 2017-01-02 6
2 2017-01-03 7
2 2017-01-04 5
5 2017-04-02 4
5 2017-04-03 2
6 2017-04-04 9
7 2017-04-05 10
1 2017-05-28 5
1 2017-05-29 3
2 2017-05-30 5
2 2017-05-31 3
I want to sum the score based on date range
condition 1
2017-01-01 - 2017-01-04
condition 2
2017-04-01 - 2017-04-30
condition 3
2017-05-01 - 2017-05-31
the goal im looking for is to generate table shown below
id sum_condition_1 sum_condition_2 sum_condition_3
1 11 null 8
2 12 null 8
5 null 6 null
6 null 9 null
7 null 10 null