I have a scenario I need help with. I have to create a sql query using SQL Server 2000 that will do the following:
I have data that looks like the table below. I need to find a way to determine an average temparture every 3 hours. The tricky part is the every 3 hour grouping should be like the following:
1st Average Grouping - (03/01/2013 13:00, 03/01/2013 14:00, 03/01/15:00)
2nd Average Grouping - (03/01/2013 14:00, 03/01/2013 15:00, 03/01/16:00)
3rd Average Grouping - (03/01/2013 15:00, 03/01/2013 16:00, 03/01/17:00)
Date Time Temperature
03/01/2013 13:00 75
03/01/2013 14:00 80
03/01/2013 15:00 82
03/01/2013 16:00 82
03/01/2013 17:00 81
03/01/2013 18:00 80
Its a weird use case and a bit diffult to put down on paper. Its an average of 3 hours, but every hour??
I would greatly appreciate any ideas on this.