Skip to content

Instantly share code, notes, and snippets.

@ddikman
Created June 13, 2022 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddikman/f2c35dae747defa218893c762abb7d07 to your computer and use it in GitHub Desktop.
Save ddikman/f2c35dae747defa218893c762abb7d07 to your computer and use it in GitHub Desktop.
Filtering events in bigquery using partitions
SELECT
count(*) as events
FROM `<project-name>.analytics_<id>.events_*`
WHERE _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', CURRENT_DATE() - 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment