在特定范围内查找数据
在特定日期的某个范围内(例如电商的黑色星期五)或在两个日期之间查找结果,是另一类常见的分析型查询。本练习将带您走过几个类似的场景。
本练习是课程的一部分
BigQuery 入门
交互式实操练习
通过完成这段示例代码来试试这个练习。
-- Fill in the query to find the total number of orders in the seven days after Black Friday
SELECT
COUNT(order_id)
FROM
ecommerce.ecomm_order_details
WHERE order_purchase_timestamp BETWEEN
-- Add the correct date part and interval
TIMESTAMP('2017-11-24') AND TIMESTAMP_ADD(TIMESTAMP('2017-11-24'), ___ ___ ___)