To keep things very simple, say I have a SQL Server 2008 table with a single column that has a datetime data type. I’d like a query that produces the number of rows for each minute interval. For example, the results would look like this:
7/3/2011 14:00:00 | 1000
7/3/2011 14:01:00 | 1097
7/3/2011 14:02:00 | 569
The first row would mean that 1000 rows have a datetime value between 7/3/2011 13:59:00 and 7/3/2011 14:00:00.
The second row would mean that 1097 rows have a datetime value between 7/3/2011 14:00:00 and 7/3/2011 14:01:00.
The third row would mean that 569 rows have a datetime value between 7/3/2011 14:01:00 and 7/3/2011 14:02:00.
Thank you.
This:
Returns