Selecting a Date Range from Tables

Tags:

February 2, 2015 | Bounteous x Accolite

Legacy SQL

SELECT 
     fullVisitorId, totals.hits
FROM   
     TABLE_DATE_RANGE(
          [google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_],
          TIMESTAMP('2013-09-01'),
          TIMESTAMP('2013-09-30'))

Standard SQL

SELECT fullVisitorId, totals.hits
FROM 'google.com:analytics-bigquery.LondonCycleHelmet.ga_sessions_*'
WHERE _TABLE_SUFFIX BETWEEN '20130901' AND '20130930'