I need a mean of all the values within that hour and I need to do it for all such hours for each day.
For Example:
Date Col1
2016-01-01 07:00:00 1
2016-01-01 07:05:00 2
2016-01-01 07:17:00 3
2016-01-01 08:13:00 2
2016-01-01 08:55:00 10
.
.
.
.
.
.
.
.
2016-12-31 22:00:00 3
2016-12-31 22:05:00 3
2016-12-31 23:13:00 4
2016-12-31 23:33:00 5
2016-12-31 23:53:00 6
So, I need to group all the values within that hour within that date into one ( it's mean ).
Expected Output:
Date Col1
2016-01-01 07:00:00 2 ##(2016-01-01 07:00:00, 07:05:00, 07:17:00) 3 values falls between the one hour range for that date i.e. 2016-01-01 07:00:00 - 2016-01-01 07:59:00, both inclusive.
2016-01-01 08:00:00 6
.
.
.
.
.
.
.
.
2016-12-31 22:00:00 3
2016-12-31 23:00:00 5
So, if I do it for whole year then in the end the total number of rows would be 365*24.
I tried solving using this answer but it doesn't work. Can anyone help me?