I need to apply row numbers to a table and have them reset to 1 every two hours based on the DateTime column value for row 1. Quite hard to explain, below is an example of what I'm trying to achieve - any ideas?
DateTime Row Number
----------- -----------
23/03/2021 12:14:59 1
23/03/2021 12:47:53 2
23/03/2021 13:24:05 3
23/03/2021 14:00:26 4
23/03/2021 14:03:27 5
23/03/2021 14:12:14 6
23/03/2021 14:14:56 7
23/03/2021 14:30:15 1
23/03/2021 15:51:28 2
23/03/2021 16:17:34 3
23/03/2021 16:22:12 4
23/03/2021 17:22:42 1
Any help would be appreciated, I'm going crazy trying to figure this out. Thanks!