First Example Query

February 02, 2015
By Bounteous

Legacy SQL

SELECT 
     hits.type, 
     count(hits.hitNumber)
FROM 
     [google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910]
GROUP BY 
     hits.type

Standard SQL

SELECT 
     hits.type, 
     COUNT(hits.hitNumber)
FROM 
     'google.com:analytics-bigquery.LondonCycleHelmet.ga_sessions_20130910' AS GA,
     UNNEST(GA.hits) AS hits
GROUP BY 
     hits.type