Common table expressions (CTEs) help you break up complex queries in BigQuery. Here's a simple query to illustrate how to write a CTE:
with beta_users as (
where beta is true
inner join beta_users on beta_users.id = events.user_id;
You can see a real example of using CTEs to generate a time series to avoid gaps in data.
Spread the word