# standardSQL
SELECT email, first_item_purchased,
MAX(purchases_within_90_days) OVER(PARTITION BY email) AS purchases_within_90_days,
MAX(purchases_within_180_days) OVER(PARTITION BY email) AS purchases_within_180_days,
MAX(purchases_within_270_days) OVER(PARTITION BY email) AS purchases_within_270_days
FROM `project.dataset.table`
1条答案
按热度按时间i2byvkas1#
下面是bigquery标准sql
如果要应用到问题中的样本数据-输出是