How to Query Wildcard Tables in BigQuery

Last updated July 26, 2026 · By the SaturnSQL team

A wildcard table like events_* matches every table sharing that prefix, and _TABLE_SUFFIX exposes the matched suffix so you can filter which tables get scanned.

SELECT _TABLE_SUFFIX AS table_date, COUNT(*) AS events
FROM `my_project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260701' AND '20260726'
GROUP BY table_date
ORDER BY table_date;

Why GA4 exports use this pattern

Google Analytics 4's BigQuery export creates one table per day named events_YYYYMMDD, so events_* plus a _TABLE_SUFFIX filter is the standard way to query a date range across those tables without listing every one by name.

Filter the suffix, not just the row data

Put the _TABLE_SUFFIX condition in the WHERE clause so BigQuery can prune whole tables before scanning; filtering only on an in-row date column after the fact still opens every sharded table.

SELECT event_name, COUNT(*) AS event_count
FROM `my_project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d', CURRENT_DATE())
GROUP BY event_name;

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related BigQuery guides