Selecting a Date Range from Tables

February 02, 2015
By Bounteous

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'