title: BigQuery select data within a time interval
body: <p>my data looks like</p>
  <blockquote>
  <p>name| From | To_City | Date of request</p>
  <p>Andy| Paris | London|  08/21/2014 12:00</p>
  <p>Lena | Koln | Berlin | 08/22/2014 18:00</p>
  <p>Andy| Paris | London |  08/22/2014 06:00</p>
  <p>Lisa | Rome | Neapel |  08/25/2014 18:00</p>
  <p>Lena | Rome | London | 08/21/2014 20:00</p>
  <p>Lisa | Rome | Neapel |  08/24/2014 18:00</p>
  <p>Andy| Paris | London|  08/25/2014 12:00</p>
  </blockquote>
  <p>I want to find how many identical drive requests a person had within +/- one day. I'd love to receive a table saying:</p>
  <blockquote>
  <p>name| From | To_City | avg Date of request | # requests</p>
  <p>Andy| Paris | London|  08/21/2014 21:00 | 2</p>
  <p>Lena | Koln | Berlin | 08/22/2014 18:00 | 1</p>
  <p>Lisa | Rome | Neapel |  08/25/2014 06:00 | 2</p>
  <p>Lena | Rome | London | 08/21/2014 20:00 | 1</p>
  <p>Andy| Paris | London|  08/25/2014 12:00 | 1</p>
  </blockquote>
  <p>This would be the result of a <em><strong>group by</strong></em> clause. But is it in general feasible to write such a condition that would check whether and how many identical request there are within 24 hours of an initial request?
  By now I download the data in Excel and do it there but there is a lot of data and hence it is not efficient...</p>
  <p>Sample data:</p>
  <p>Let's build a sample dataset first:</p>
  <pre><code>select * from (select 'Andy' as name,'Paris' as f,'London' as to, '2014-08-21 12:00' as date),
  (select 'Lena' as name,'Koln' as f,'Berlin' as to, '2014-08-22 18:00' as date),
  (select 'Andy' as name,'Paris' as f,'London' as to, '2014-08-22 06:00' as date),
  (select 'Lisa' as name,'Rome' as f,'Neapel' as to, '2014-08-25 18:00' as date),
  (select 'Lena' as name,'Rome' as f,'London' as to, '2014-08-21 20:00' as date),
  (select 'Lisa' as name,'Rome' as f,'Neapel' as to, '2014-08-24 18:00' as date),
  (select 'Andy' as name,'Paris' as f,'London' as to, '2014-08-25 12:00' as date)
  </code></pre>