title: Mysql: Calculate averge time between visits
body: <p>This related to my <a href="https://stackoverflow.com/q/3743447/387194">other question</a>.  </p>
  
  <p>I have this table</p>
  
  <pre><code>CREATE OR REPLACE TABLE hits (ip bigint, page VARCHAR(256), agent VARCHAR(1000), 
                                date datetime)
  </code></pre>
  
  <p>and I want to calculate average time between googlebot visit for every page.</p>
  
  <pre><code>... WHERE agent like '%Googlebot%' group by page order by date
  </code></pre>
  
  <p>Something like </p>
  
  <pre><code>select datediff('2010-09-18 04:20:47', '2010-09-16 05:23:04')
  </code></pre>
  
  <p>but for every date in table<br>
  If there is no mysql way, how can I do this in php?</p>