Hi guys
I have a mysql db and am calling info with php. What I would like help with is how to do what I want to do, here is the data
39 -- 2010-10-31 12:34:00 -- 1 <---
40 -- 2010-10-31 12:34:00 -- 7
41 -- 2010-10-31 12:34:00 -- 9
42 -- 2010-10-31 12:34:00 -- 1 <---
43 -- 2010-10-31 12:34:00 -- 4
52 -- 2010-10-31 12:34:00 -- 1 <---
53 -- 2010-10-31 12:34:00 -- 7
54 -- 2010-10-31 12:34:00 -- 9
55 -- 2010-10-31 12:34:00 -- 9
56 -- 2010-10-31 12:34:00 -- 1 <---
57 -- 2010-10-31 12:34:00 -- 4
58 -- 2010-10-31 12:34:00 -- 2
Using the number 1 as an example, I would like to work out the average gap between the number 1s' so for the above I would like to have
gaps = 2,1,3 (the number of rows between entries with 1)
Then I would like to grab from that
Average gap 2+1+3/3 = 2
Largest gap = 3
Smallest gap = 1
So the question, how do I get the gaps between the record, the dates wont work neither will using the first REF column as the can be in different chunks of entries.
Any help or pointers appreciated, thanks in advance