This related to my other question.
I have this table
CREATE OR REPLACE TABLE hits (ip bigint, page VARCHAR(256), agent VARCHAR(1000),
date datetime)
and I want to calculate average time between googlebot visit for every page.
... WHERE agent like '%Googlebot%' group by page order by date
Something like
select datediff('2010-09-18 04:20:47', '2010-09-16 05:23:04')
but for every date in table
If there is no mysql way, how can I do this in php?
TIMESTAMPDIFF(SECOND, a, b)returns the difference in seconds between the date expressions a and b. For each page, the query finds the date of the first and last visit and the total count of visits, and calculates the arithmetic average.