For example I have a table that has the number of people in a room at a given time
room_color people time
red 100 2012-07-13 11:11:11
red 120 2012-07-13 11:14:12
red 130 2012-07-13 11:17:13
green ... etc
How do I find the average amount of people in the room in a 10 minute interval, for example to summarize the amount of people in the red room at 11:10 to be ~117
I know some ways to do this but it all involves creating a new table, how do I do this without creating a new table? I simply want to delete irrelevant data.
Try this, if you want you may use two datetime variables and add to one 10 minutes. using the variables in the between clause.
hope this helps.