how to count how many um_no by different section and cumulative by hour with no specific function
original:
+-------+------+------+-----+
| um_no | nums | hour | day |
+-------+------+------+-----+
| mary | 3 | 8 | 1 |
| john | 6 | 8 | 1 |
| peter | 2 | 8 | 1 |
| jason | 1 | 8 | 1 |
| mary | 5 | 9 | 1 |
| john | 6 | 9 | 1 |
| peter | 6 | 9 | 1 |
| jason | 1 | 9 | 1 |
| mary | 5 | 10 | 1 |
| john | 4 | 10 | 1 |
| peter | 2 | 10 | 1 |
| jason | 4 | 10 | 1 |
+-------+------+------+-----+
want:
+-----+------+---------+----------+-----------+----------+
| day | hour | nums0_5 | nums5_10 | nums10_15 | nums15up |
+-----+------+---------+----------+-----------+----------+
| 1 | 8 | 3 | 1 | 0 | 0 |
| 1 | 9 | 1 | 2 | 1 | 0 |
| 1 | 10 | 0 | 2 | 1 | 1 |
+-----+------+---------+----------+-----------+----------+