I have a table which will log all the data based on one minute interval. Now I want to retrieve the records such that, if the time interval is given 2 minutes it should add the complete records with 2 minutes interval and show on screen..
Suppose the Table is:
Date | Time | Data
20-11-2011| 9:00 | 2
20-11-2011| 9:01 | 3
20-11-2011| 9:02 | 6
20-11-2011| 9:03 | 2
20-11-2011| 9:04 | 1
20-11-2011| 9:05 | 4
20-11-2011| 9:06 | 4
So, if the start date is selected as 20-11-2011 and start time as 9:01 and interval as 2 minutes, then the table should be:
Date | Time | Data
20-11-2011| 9:01 | 9
20-11-2011| 9:03 | 3
20-11-2011| 9:05 | 8
Kindly help me with this, I’m new to mysql and php
Here: Time is a Timestamp type..
This should work: