Skip to content

Instantly share code, notes, and snippets.

@vinoaj
Created January 11, 2019 00:26
Show Gist options
  • Save vinoaj/eaef45092ccafd9360388bc1011aa6b5 to your computer and use it in GitHub Desktop.
Save vinoaj/eaef45092ccafd9360388bc1011aa6b5 to your computer and use it in GitHub Desktop.
BQ SQL GA360: Report on when daily tables were created
# standardSQL
SELECT
*
, TIMESTAMP_MILLIS(CAST(creation_time AS INT64)) AS date_creation
, DATETIME(TIMESTAMP_MILLIS(CAST(creation_time AS INT64)), "Australia/Sydney") AS date_creation_au
FROM `project_id.dataset_id.__TABLES__`
WHERE STARTS_WITH(table_id, "ga_sessions_201901")
ORDER BY table_id DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment