Hi there,
I have a table with a start date and a stop date. I would like to count for every full hour from minimal start date to maximal stop date, how many occurences are for start_date_normalized_to_full_hour <= full_hour_variable <= stop_date.
|rowid|start_date|stop_date|
|1|01.01.2018 06:13|01.01.2018 08:18|
|2|01.01.2018 07:13|01.01.2018 09:18|
|3|01.01.2018 08:13|01.01.2018 10:18|
|4|01.01.2018 09:13|01.01.2018 11:18|
|5|01.01.2018 06:13|01.01.2018 12:18|
|6|01.01.2018 10:13|01.01.2018 13:18|
with the following result
|date|occurence|
|01.01.2018 06:00|2|
|01.01.2018 07:00|3|
|01.01.2018 08:00|4|
|01.01.2018 09:00|4|
|01.01.2018 10:00|4|
|01.01.2018 11:00|3|
Many thanks